Line 740... |
Line 740... |
reg sw_lut_enable_o;
|
reg sw_lut_enable_o;
|
always @ (posedge mclk or posedge puc_rst)
|
always @ (posedge mclk or posedge puc_rst)
|
if (puc_rst) sw_lut_enable_o <= 1'b0;
|
if (puc_rst) sw_lut_enable_o <= 1'b0;
|
else if (lut_cfg_wr) sw_lut_enable_o <= per_din_i[0]; // Enable software color LUT
|
else if (lut_cfg_wr) sw_lut_enable_o <= per_din_i[0]; // Enable software color LUT
|
|
|
|
reg sw_lut_ram_rmw_mode;
|
|
always @ (posedge mclk or posedge puc_rst)
|
|
if (puc_rst) sw_lut_ram_rmw_mode <= 1'b0;
|
|
else if (lut_cfg_wr) sw_lut_ram_rmw_mode <= per_din_i[1];
|
|
|
`ifdef WITH_EXTRA_LUT_BANK
|
`ifdef WITH_EXTRA_LUT_BANK
|
reg sw_lut_bank_select_o;
|
reg sw_lut_bank_select_o;
|
always @ (posedge mclk or posedge puc_rst)
|
always @ (posedge mclk or posedge puc_rst)
|
if (puc_rst) sw_lut_bank_select_o <= 1'b0;
|
if (puc_rst) sw_lut_bank_select_o <= 1'b0;
|
else if (lut_cfg_wr) sw_lut_bank_select_o <= per_din_i[2];
|
else if (lut_cfg_wr) sw_lut_bank_select_o <= per_din_i[2];
|
Line 751... |
Line 756... |
assign sw_lut_bank_select_o = 1'b0;
|
assign sw_lut_bank_select_o = 1'b0;
|
`endif
|
`endif
|
`else
|
`else
|
assign sw_lut_bank_select_o = 1'b0;
|
assign sw_lut_bank_select_o = 1'b0;
|
assign sw_lut_enable_o = 1'b0;
|
assign sw_lut_enable_o = 1'b0;
|
|
wire sw_lut_ram_rmw_mode = 1'b0;
|
`endif
|
`endif
|
|
|
reg [2:0] hw_lut_palette_sel_o;
|
reg [2:0] hw_lut_palette_sel_o;
|
always @ (posedge mclk or posedge puc_rst)
|
always @ (posedge mclk or posedge puc_rst)
|
if (puc_rst) hw_lut_palette_sel_o <= 3'h0;
|
if (puc_rst) hw_lut_palette_sel_o <= 3'h0;
|
Line 770... |
Line 776... |
if (puc_rst) hw_lut_fgcolor_o <= 4'hf;
|
if (puc_rst) hw_lut_fgcolor_o <= 4'hf;
|
else if (lut_cfg_wr) hw_lut_fgcolor_o <= per_din_i[15:12];
|
else if (lut_cfg_wr) hw_lut_fgcolor_o <= per_din_i[15:12];
|
|
|
wire [15:0] lut_cfg_rd = {hw_lut_fgcolor_o, hw_lut_bgcolor_o,
|
wire [15:0] lut_cfg_rd = {hw_lut_fgcolor_o, hw_lut_bgcolor_o,
|
1'b0, hw_lut_palette_sel_o,
|
1'b0, hw_lut_palette_sel_o,
|
1'b0, sw_lut_bank_select_o, 1'b0, sw_lut_enable_o};
|
1'b0, sw_lut_bank_select_o,
|
|
sw_lut_ram_rmw_mode, sw_lut_enable_o};
|
|
|
//------------------------------------------------
|
//------------------------------------------------
|
// LUT_RAM_ADDR Register
|
// LUT_RAM_ADDR Register
|
//------------------------------------------------
|
//------------------------------------------------
|
`ifdef WITH_PROGRAMMABLE_LUT
|
`ifdef WITH_PROGRAMMABLE_LUT
|
Line 829... |
Line 836... |
if (puc_rst) lut_ram_data <= 16'h0000;
|
if (puc_rst) lut_ram_data <= 16'h0000;
|
else if (lut_ram_data_wr) lut_ram_data <= per_din_i;
|
else if (lut_ram_data_wr) lut_ram_data <= per_din_i;
|
else if (lut_ram_dout_rdy) lut_ram_data <= lut_ram_dout_i;
|
else if (lut_ram_dout_rdy) lut_ram_data <= lut_ram_dout_i;
|
|
|
// Increment the address after a write or read access to the LUT_RAM_DATA register
|
// Increment the address after a write or read access to the LUT_RAM_DATA register
|
assign lut_ram_addr_inc_wr = lut_ram_data_wr | lut_ram_data_rd;
|
// - one clock cycle after a write access
|
|
// - with the read access (if not in read-modify-write mode)
|
|
assign lut_ram_addr_inc_wr = lut_ram_data_wr | (lut_ram_data_rd & ~dbg_freeze_i & ~sw_lut_ram_rmw_mode);
|
|
|
// Apply peripheral data bus % write strobe during VID_RAMx_DATA write access
|
// Apply peripheral data bus % write strobe during VID_RAMx_DATA write access
|
assign lut_ram_din_o = per_din_i & {16{lut_ram_data_wr}};
|
assign lut_ram_din_o = per_din_i & {16{lut_ram_data_wr}};
|
assign lut_ram_wen_o = ~(|per_we_i & lut_ram_data_wr);
|
assign lut_ram_wen_o = ~(|per_we_i & lut_ram_data_wr);
|
|
|