Skip to content

Commit

Permalink
Optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
mole99 committed Sep 27, 2023
1 parent 50128d7 commit 77fe5d1
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
30 changes: 17 additions & 13 deletions src/background.sv
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,31 @@ 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:
color_out = color3;
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

Expand Down
2 changes: 1 addition & 1 deletion src/config.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/spi_receiver.sv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/top.sv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 77fe5d1

Please sign in to comment.