File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ THE SOFTWARE.
3232module i2c_master_wbs_8 #
3333(
3434 parameter DEFAULT_PRESCALE = 1 ,
35+ parameter FIXED_PRESCALE = 0 ,
3536 parameter CMD_FIFO = 1 ,
3637 parameter CMD_FIFO_ADDR_WIDTH = 5 ,
3738 parameter WRITE_FIFO = 1 ,
@@ -384,11 +385,15 @@ always @* begin
384385 end
385386 4'h6 : begin
386387 // prescale low
387- prescale_next[7 :0 ] = wbs_dat_i;
388+ if (! FIXED_PRESCALE) begin
389+ prescale_next[7 :0 ] = wbs_dat_i;
390+ end
388391 end
389392 4'h7 : begin
390393 // prescale high
391- prescale_next[15 :8 ] = wbs_dat_i;
394+ if (! FIXED_PRESCALE) begin
395+ prescale_next[15 :8 ] = wbs_dat_i;
396+ end
392397 end
393398 endcase
394399 wbs_ack_o_next = ~ wbs_ack_o_reg;
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ def bench():
4747
4848 # Parameters
4949 DEFAULT_PRESCALE = 1
50+ FIXED_PRESCALE = 0
5051 CMD_FIFO = 1
5152 CMD_FIFO_ADDR_WIDTH = 5
5253 WRITE_FIFO = 1
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ module test_i2c_master_wbs_8;
3333
3434// Parameters
3535parameter DEFAULT_PRESCALE = 1 ;
36+ parameter FIXED_PRESCALE = 0 ;
3637parameter CMD_FIFO = 1 ;
3738parameter CMD_FIFO_ADDR_WIDTH = 5 ;
3839parameter WRITE_FIFO = 1 ;
9192
9293i2c_master_wbs_8 #(
9394 .DEFAULT_PRESCALE(DEFAULT_PRESCALE),
95+ .FIXED_PRESCALE(FIXED_PRESCALE),
9496 .CMD_FIFO(CMD_FIFO),
9597 .CMD_FIFO_ADDR_WIDTH(CMD_FIFO_ADDR_WIDTH),
9698 .WRITE_FIFO(WRITE_FIFO),
You can’t perform that action at this time.
0 commit comments