Skip to content

Commit 4e28179

Browse files
committed
sdram_ctrl: Implement full read/write/refresh paths and fix bugs
Made-with: Cursor
1 parent 7905307 commit 4e28179

File tree

2 files changed

+433
-227
lines changed

2 files changed

+433
-227
lines changed

rtl/gowin/sdram_ctrl.sby

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,28 @@ prove
55
[options]
66
prove: mode prove
77
cover: mode cover
8-
prove: depth 20
9-
cover: depth 120
8+
prove: depth 50
9+
cover: depth 80
1010

1111
[engines]
1212
smtbmc z3
1313

1414
[script]
1515
read -formal sdram_ctrl.v
16-
proc -norom
16+
# Scale down all timing so the full init+read+write sequence fits in <80 cycles:
17+
# INIT_CYCLES = (2000 * 1) / 1000 = 2
18+
# T_RP=T_RFC=T_MRD=T_RCD=T_CL=T_WR = 2
19+
# REFRESH_INTERVAL = (4096 / 1 * 1) / 1000 = 4 (so refresh fires every 4 cycles)
20+
chparam -set CLOCK_FREQ_MHZ 1 sdram_ctrl
21+
chparam -set INITIALIZATION_WAIT_PERIOD_NS 2000 sdram_ctrl
22+
chparam -set REFRESH_PERIOD_NS 4096 sdram_ctrl
23+
chparam -set REFRESH_TIMES 1 sdram_ctrl
24+
chparam -set T_RP_PERIOD 2 sdram_ctrl
25+
chparam -set T_RFC_PERIOD 2 sdram_ctrl
26+
chparam -set T_MRD_PERIOD 2 sdram_ctrl
27+
chparam -set T_RCD_PERIOD 2 sdram_ctrl
28+
chparam -set T_CL_PERIOD 2 sdram_ctrl
29+
chparam -set T_WR_PERIOD 2 sdram_ctrl
1730
prep -top sdram_ctrl
1831

1932
[files]

0 commit comments

Comments
 (0)