Skip to content

Commit 7f0b16d

Browse files
authored
Merge pull request #441 from os-fpga/task/EDA-3187/add_setup_lec_sim
EDA-3187 add setup lec sim
2 parents 5a5dc97 + 049e8f1 commit 7f0b16d

File tree

8 files changed

+25
-12
lines changed

8 files changed

+25
-12
lines changed

RTL_testcases/RTL_Benchmarks_Gap_Analysis/doc_ip_litex/raptor_run.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,9 @@ parse_cga exit 1; }
259259
else
260260
echo ""
261261
fi
262+
echo "setup_lec_sim">>raptor_tcl.tcl
263+
[ "$tool_name" = "iverilog" ] && echo "simulate gate icarus">>raptor_tcl.tcl || echo "simulate gate verilator">>raptor_tcl.tcl
264+
[ "$tool_name" = "iverilog" ] && echo "simulate pnr icarus">>raptor_tcl.tcl || echo "simulate pnr verilator">>raptor_tcl.tcl
262265
echo "sta">>raptor_tcl.tcl
263266
echo "power">>raptor_tcl.tcl
264267
echo "bitstream $bitstream">>raptor_tcl.tcl
@@ -272,6 +275,8 @@ parse_cga exit 1; }
272275
fi
273276
fi
274277

278+
[ -f rtl/sim.v ] && sed -i -e "s|MEM_FILE_PATH|$PWD/rtl|g" rtl/sim.v
279+
275280
cd results_dir
276281
echo "Device: $device">>results.log
277282
echo "Strategy: $strategy">>results.log

RTL_testcases/RTL_Benchmarks_Gap_Analysis/doc_ip_litex/rtl/sim.v

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,7 +1405,7 @@ end
14051405
// Port 0 | Read: Sync | Write: ---- |
14061406
reg [31:0] mem[0:5393];
14071407
initial begin
1408-
$readmemh("mem.init", mem);
1408+
$readmemh("MEM_FILE_PATH/mem.init", mem);
14091409
end
14101410
reg [31:0] mem_dat0;
14111411
always @(posedge sys_clk_1) begin
@@ -1420,7 +1420,7 @@ assign main_simsoc_dat_r = mem_dat0;
14201420
// Port 0 | Read: Sync | Write: Sync | Mode: Write-First | Write-Granularity: 8
14211421
reg [31:0] mem_1[0:874];
14221422
initial begin
1423-
$readmemh("mem_1.init", mem_1);
1423+
$readmemh("MEM_FILE_PATH/mem_1.init", mem_1);
14241424
end
14251425
reg [9:0] mem_1_adr0;
14261426
always @(posedge sys_clk_1) begin
@@ -1443,7 +1443,7 @@ assign main_ram_dat_r = mem_1[mem_1_adr0];
14431443
// Port 0 | Read: Sync | Write: ---- |
14441444
reg [7:0] mem_2[0:36];
14451445
initial begin
1446-
$readmemh("mem_2.init", mem_2);
1446+
$readmemh("MEM_FILE_PATH/mem_2.init", mem_2);
14471447
end
14481448
reg [5:0] mem_2_adr0;
14491449
always @(posedge sys_clk_1) begin
@@ -1458,8 +1458,8 @@ assign builder_csr_bankarray_dat_r = mem_2[mem_2_adr0];
14581458
// Port 0 | Read: Sync | Write: Sync | Mode: Read-First | Write-Granularity: 10
14591459
// Port 1 | Read: Sync | Write: ---- |
14601460
reg [9:0] storage[0:15];
1461-
reg [9:0] storage_dat0;
1462-
reg [9:0] storage_dat1;
1461+
reg [9:0] storage_dat0=10'd0;
1462+
reg [9:0] storage_dat1=10'd0;
14631463
always @(posedge sys_clk_1) begin
14641464
if (main_uart_tx_fifo_wrport_we)
14651465
storage[main_uart_tx_fifo_wrport_adr] <= main_uart_tx_fifo_wrport_dat_w;

RTL_testcases/RTL_Benchmarks_Gap_Analysis/down_counter/raptor_run.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,9 @@ parse_cga exit 1; }
258258
else
259259
echo ""
260260
fi
261+
echo "setup_lec_sim">>raptor_tcl.tcl
262+
[ "$tool_name" = "iverilog" ] && echo "simulate gate icarus">>raptor_tcl.tcl || echo "simulate gate verilator">>raptor_tcl.tcl
263+
[ "$tool_name" = "iverilog" ] && echo "simulate pnr icarus">>raptor_tcl.tcl || echo "simulate pnr verilator">>raptor_tcl.tcl
261264
echo "sta">>raptor_tcl.tcl
262265
echo "power">>raptor_tcl.tcl
263266
echo "bitstream $bitstream">>raptor_tcl.tcl

RTL_testcases/RTL_Benchmarks_Gap_Analysis/down_counter/rtl/param_down_counter.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module param_down_counter (clk_counter, q_counter, rst_counter);
1313
input clk_counter;
1414
input rst_counter;
1515
output [`size-1:0] q_counter;
16-
reg [`size-1:0] q_counter ='b0;
16+
reg [`size-1:0] q_counter =5'h1F;
1717

1818
always @ (posedge clk_counter or posedge rst_counter)
1919

RTL_testcases/RTL_Benchmarks_Gap_Analysis/dpll-isdn/raptor_run.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ parse_cga exit 1; }
262262
else
263263
echo ""
264264
fi
265+
echo "setup_lec_sim">>raptor_tcl.tcl
266+
[ "$tool_name" = "iverilog" ] && echo "simulate gate icarus">>raptor_tcl.tcl || echo "simulate gate verilator">>raptor_tcl.tcl
267+
[ "$tool_name" = "iverilog" ] && echo "simulate pnr icarus">>raptor_tcl.tcl || echo "simulate pnr verilator">>raptor_tcl.tcl
265268
echo "sta">>raptor_tcl.tcl
266269
echo "power">>raptor_tcl.tcl
267270
echo "bitstream $bitstream">>raptor_tcl.tcl

RTL_testcases/RTL_Benchmarks_Gap_Analysis/dpll-isdn/rtl/freqdivider.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ parameter DividerLength = 7;
1717

1818
parameter DividerMaxValue = 48;
1919

20-
reg [DividerLength-1 : 0] DividerCounter;
21-
reg FrequencyOut; // registered output
20+
reg [DividerLength-1 : 0] DividerCounter = {DividerLength{1'b0}};
21+
reg FrequencyOut = 0; // registered output
2222

2323
/* Process of freq. division according to signals from Random Deviations Filter: */
2424
/* if "lag" then counter will incremented by 2 */

RTL_testcases/RTL_Benchmarks_Gap_Analysis/dpll-isdn/rtl/randomwalkfilter.v

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ parameter FilterMaxValue = FilterResetValue;
1111
parameter FilterMinValue = 256 - FilterResetValue;
1212

1313
/* reversive counter */
14-
reg [FilterLength-1 : 0] FilterCounter;
14+
reg [FilterLength-1 : 0] FilterCounter = {FilterLength{1'b0}};
1515

1616
/* calculation of output pulses synchrinized with MainClock */
1717
always @(posedge MainClock)
@@ -27,7 +27,8 @@ always @(posedge MainClock)
2727

2828
/* making "Lead" and "Lag" signals when */
2929
/* counter reached max or min levels */
30-
reg Positive, Negative;
30+
reg Positive = 0;
31+
reg Negative = 0;
3132
always @(posedge MainClock)
3233
begin
3334
Positive <= (FilterCounter == FilterMaxValue);

RTL_testcases/RTL_Benchmarks_Gap_Analysis/dpll-isdn/rtl/variableresetrandomwalkfilter.v

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ parameter ResetterCounterMaxValue = 3;
2020
parameter ResetterCounterMinValue = 16 - 3;
2121

2222
/* counter "N - RandomWalkFilter" */
23-
reg [N_FilterLength-1 : 0] N_FilterCounter;
23+
reg [N_FilterLength-1 : 0] N_FilterCounter = {N_FilterLength{1'b0}};
2424

2525
/* connections of "M - RandomWalkFilter" */
2626
wire Up, Down;
@@ -77,7 +77,8 @@ always @(posedge MainClock)
7777

7878
/* making "Lead" and "Lag" signals when */
7979
/* counter reached max or min levels */
80-
reg Positive, Negative;
80+
reg Positive = 0;
81+
reg Negative = 0;
8182
always @(posedge MainClock)
8283
begin
8384
Positive <= (N_FilterCounter == N_FilterMaxValue);

0 commit comments

Comments
 (0)