diff --git a/config.json b/config.json index 087d2f9..a9bfb70 100644 --- a/config.json +++ b/config.json @@ -11,7 +11,7 @@ "RIGHT_MARGIN_MULT": 6, "pdk::sky130A": { "MAX_FANOUT_CONSTRAINT": 6, - "PL_TARGET_DENSITY_PCT": 90, + "PL_TARGET_DENSITY_PCT": 88, "scl::sky130_fd_sc_hd": { "CLOCK_PERIOD": 15 } diff --git a/src/background.sv b/src/background.sv index f9bfec9..d410ac4 100644 --- a/src/background.sv +++ b/src/background.sv @@ -41,6 +41,21 @@ module background #( assign color_sel2 = tmp2[6:5]; + + logic color_sel; + assign color_sel = bg_select[0] ? color_sel2 : color_sel1; + + logic [5:0] tmp_color; + + always_comb begin + case (color_sel) + 2'b00: tmp_color = color1; + 2'b01: tmp_color = color2; + 2'b10: tmp_color = color3; + 2'b11: tmp_color = color4; + endcase + end + always_comb begin case (bg_select) 2'b00: @@ -48,20 +63,9 @@ module background #( 2'b01: color_out = (counter_h[7:2] ^ counter_v[7:2]) + cur_time[7:2]; 2'b10: - case (color_sel1) - 2'b00: color_out = color1; - 2'b01: color_out = color2; - 2'b10: color_out = color3; - 2'b11: color_out = color4; - endcase + color_out = tmp_color; 2'b11: - case (color_sel2) - 2'b00: color_out = color1; - 2'b01: color_out = color2; - 2'b10: color_out = color3; - 2'b11: color_out = color4; - endcase - + color_out = tmp_color; endcase end diff --git a/src/config.tcl b/src/config.tcl index 8e9d215..c2c0b71 100644 --- a/src/config.tcl +++ b/src/config.tcl @@ -12,7 +12,7 @@ # PL_TARGET_DENSITY - You can increase this if Global Placement fails with error GPL-0302. # Users have reported that values up to 0.8 worked well for them. -set ::env(PL_TARGET_DENSITY) 0.89 +set ::env(PL_TARGET_DENSITY) 0.88 # CLOCK_PERIOD - Increase this in case you are getting setup time violations. # The value is in nanoseconds, so 20ns == 50MHz. diff --git a/src/spi_receiver.sv b/src/spi_receiver.sv index 97d5937..e0fb3cf 100644 --- a/src/spi_receiver.sv +++ b/src/spi_receiver.sv @@ -33,7 +33,7 @@ module spi_receiver #( output logic [5:0] color2, // color2 register output logic [5:0] color3, // color3 register output logic [5:0] color4, // color4 register - output logic [7:0] misc // miscellaneous register + output logic [4:0] misc // miscellaneous register ); // Synchronizer to prevent metastability diff --git a/src/top.sv b/src/top.sv index 1e4a11e..5fc8a44 100644 --- a/src/top.sv +++ b/src/top.sv @@ -75,8 +75,7 @@ module top ( localparam bit ENABLE_SPRITE_BG_DEFAULT = 1'b0; localparam bit REDUCED_FREQ_DEFAULT = 1'b0; - localparam bit [7:0] MISC_DEFAULT = { 3'b000, - REDUCED_FREQ_DEFAULT, + localparam bit [4:0] MISC_DEFAULT = { REDUCED_FREQ_DEFAULT, ENABLE_SPRITE_BG_DEFAULT, ENABLE_MOVEMENT_DEFAULT, BACKGROUND_DEFAULT