Commit 65f694fc authored by Iulian Gheorghiu's avatar Iulian Gheorghiu

Add registers definitions according to header file

parent ed46a03a
......@@ -21,13 +21,6 @@
`include "io_s_h.v"
`define GFX_ACCEL_IDLE 0
`define GFX_ACCEL_VRAM_ACCESS 1
`define GFX_ACCEL_PIXEL_LOAD 2
`define GFX_ACCEL_PIXEL 3
`define GFX_ACCEL_CTRL_ACCESS 4
`define GFX_ACCEL_FILL_RECT 5
/*
* The first sixteen addresses after ADDRESS parameter address are used by LCD IP, the next sixteen addresses are used by this IP.
*/
......@@ -189,19 +182,19 @@ begin
if(wr_int && !CMD)
begin
case(ctrl_addr[4:0])
'd16: CMD <= ctrl_data_in;
'd18: CLIP_X_MIN <= {tmp_write, ctrl_data_in};
'd19: tmp_write <= ctrl_data_in;
'd20: CLIP_X_MAX <= {tmp_write, ctrl_data_in};
'd21: tmp_write <= ctrl_data_in;
'd22: CLIP_Y_MIN <= {tmp_write, ctrl_data_in};
'd23: tmp_write <= ctrl_data_in;
'd24: CLIP_Y_MAX <= {tmp_write, ctrl_data_in};
'd25: tmp_write <= ctrl_data_in;
'd26: COLOR <= {color_byte_3, color_byte_2, tmp_write, ctrl_data_in};
'd27: tmp_write <= ctrl_data_in;
'd28: color_byte_2 <= ctrl_data_in;
'd29: color_byte_3 <= ctrl_data_in;
`GFX_ACCEL_CMD: CMD <= ctrl_data_in;
`GFX_ACCEL_CLIP_X_MIN_L: CLIP_X_MIN <= {tmp_write, ctrl_data_in};
`GFX_ACCEL_CLIP_X_MIN_H: tmp_write <= ctrl_data_in;
`GFX_ACCEL_CLIP_X_MAX_L: CLIP_X_MAX <= {tmp_write, ctrl_data_in};
`GFX_ACCEL_CLIP_X_MAX_H: tmp_write <= ctrl_data_in;
`GFX_ACCEL_CLIP_Y_MIN_L: CLIP_Y_MIN <= {tmp_write, ctrl_data_in};
`GFX_ACCEL_CLIP_Y_MIN_H: tmp_write <= ctrl_data_in;
`GFX_ACCEL_CLIP_Y_MAX_L: CLIP_Y_MAX <= {tmp_write, ctrl_data_in};
`GFX_ACCEL_CLIP_Y_MAX_H: tmp_write <= ctrl_data_in;
`GFX_ACCEL_BYTE_0: COLOR <= {color_byte_3, color_byte_2, tmp_write, ctrl_data_in};
`GFX_ACCEL_BYTE_1: tmp_write <= ctrl_data_in;
`GFX_ACCEL_BYTE_2: color_byte_2 <= ctrl_data_in;
`GFX_ACCEL_BYTE_3: color_byte_3 <= ctrl_data_in;
endcase
end
else if(!cmd_int && CMD)
......@@ -220,17 +213,17 @@ begin
else
begin
case(cmd_int)
`GFX_ACCEL_VRAM_ACCESS:
`GFX_ACCEL_CMD_VRAM_ACCESS:
begin
direct_vram_access <= 1'b1;
cmd_int <= 'h0;
end
`GFX_ACCEL_CTRL_ACCESS:
`GFX_ACCEL_CMD_CTRL_ACCESS:
begin
direct_vram_access <= 1'b0;
cmd_int <= 'h0;
end
`GFX_ACCEL_PIXEL_LOAD:
`GFX_ACCEL_CMD_PIXEL_LOAD:
begin
x_xnt_int <= CLIP_X_MIN;
y_xnt_int <= CLIP_Y_MIN;
......@@ -242,7 +235,7 @@ begin
end
cmd_int <= 'h0;
end
`GFX_ACCEL_PIXEL:
`GFX_ACCEL_CMD_PIXEL:
begin
color <= COLOR;
if(x_xnt_int >= clip_x_max_int)
......@@ -252,7 +245,7 @@ begin
end
cmd_int <= 'h0;
end
`GFX_ACCEL_FILL_RECT:
`GFX_ACCEL_CMD_FILL_RECT:
begin
if(~new_cmd)
begin
......@@ -284,7 +277,7 @@ begin
if(rd_int)
begin
case(ctrl_addr[4:0])
'd16: ctrl_data_out <= CMD;
`GFX_ACCEL_CMD: ctrl_data_out <= CMD;
default: ctrl_data_out <= 'hz;
endcase
end
......@@ -296,7 +289,7 @@ end
assign lcd_vmem_addr = direct_vram_access ? vmem_addr : (x_xnt_int * H_RES_CONF) + y_xnt_int;
assign lcd_vmem_in = direct_vram_access ? vmem_in : color;
assign vmem_out = direct_vram_access ? vmem_out : 'hz;
assign vmem_out = direct_vram_access ? lcd_vmem_out : 'hz;
assign lcd_vmem_rd = direct_vram_access ? vmem_rd : 1'h0;
assign lcd_vmem_wr = direct_vram_access ? vmem_wr : |cmd_int;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment