Skip to content

Commit 51e4a88

Browse files
committed
ql: pp3: installed tests: counter_gclk: enable simulation
Signed-off-by: Paweł Czarnecki <[email protected]>
1 parent 82382c1 commit 51e4a88

File tree

2 files changed

+67
-2
lines changed

2 files changed

+67
-2
lines changed

quicklogic/pp3/tests/features/install_test/counter_gclk/CMakeLists.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
add_binary_toolchain_test(
22
TEST_NAME counter_gclk
3+
ARCH pp3
34
DEVICE ql-eos-s3
45
PINMAP PD64
56
PCF chandalar.pcf
67
EXTRA_ARGS "-dump post_verilog"
78

9+
ENABLE_SIMULATION
10+
811
CHECK_CONSTRAINTS
912
ASSERT_USAGE PB-CLOCK=1,PB-GMUX=1,PB-BIDIR=4
1013
ASSERT_TIMING fmax>56.0
@@ -18,13 +21,16 @@ add_binary_toolchain_test(
1821
)
1922

2023
add_binary_toolchain_test(
21-
TEST_NAME counter_gclk_wd30
24+
TEST_NAME counter_gclk
2225
SOURCES "counter_gclk.v"
26+
ARCH pp3
2327
DEVICE ql-pp3
2428
PINMAP WD30
2529
PCF jimbob4.pcf
2630
EXTRA_ARGS "-dump post_verilog"
2731

32+
ENABLE_SIMULATION
33+
2834
CHECK_CONSTRAINTS
2935
ASSERT_USAGE PB-CLOCK=1,PB-GMUX=1,PB-BIDIR=4
3036
ASSERT_TIMING fmax>56.0
@@ -38,13 +44,16 @@ add_binary_toolchain_test(
3844
)
3945

4046
add_binary_toolchain_test(
41-
TEST_NAME counter_gclk_pd64
47+
TEST_NAME counter_gclk
4248
SOURCES "counter_gclk.v"
49+
ARCH pp3
4350
DEVICE ql-pp3
4451
PINMAP PD64
4552
PCF pd64.pcf
4653
EXTRA_ARGS "-dump post_verilog"
4754

55+
ENABLE_SIMULATION
56+
4857
CHECK_CONSTRAINTS
4958
ASSERT_USAGE PB-CLOCK=1,PB-GMUX=1,PB-BIDIR=4
5059
ASSERT_TIMING fmax>40.0
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
`timescale 1 ps / 1 ps
2+
3+
`default_nettype none
4+
5+
`define STRINGIFY(x) `"x`"
6+
7+
8+
module tb;
9+
10+
task assert(input a);
11+
begin
12+
if (a==0) begin
13+
$display("******************");
14+
$display("* ASSERT FAILURE *");
15+
$display("******************");
16+
$dumpflush;
17+
$finish_and_return(-1);
18+
end
19+
end
20+
endtask
21+
22+
reg clk;
23+
wire [3:0] out;
24+
integer i;
25+
26+
27+
`ifdef NO_SPLIT
28+
top dut (
29+
.clk (clk),
30+
.led (out)
31+
);
32+
`else
33+
top dut (
34+
.\clk (clk),
35+
.\led[0] (out[0]),
36+
.\led[1] (out[1]),
37+
.\led[2] (out[2]),
38+
.\led[3] (out[3])
39+
);
40+
`endif
41+
42+
initial begin
43+
clk = 1'b0;
44+
`ifndef F2B
45+
$sdf_annotate(`STRINGIFY(`SDF), dut);
46+
`endif
47+
$dumpfile(`STRINGIFY(`VCD));
48+
$dumpvars;
49+
for (i=1; i<64; i=i+1) begin
50+
#1000000 clk = 1;
51+
#500000 assert(out === (i % 16));
52+
#500000 clk = 0;
53+
end
54+
#25 $finish();
55+
end
56+
endmodule

0 commit comments

Comments
 (0)