Skip to content

Commit 87c664e

Browse files
committed
Add test files
1 parent fbdc078 commit 87c664e

File tree

6,470 files changed

+3928908
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

6,470 files changed

+3928908
-0
lines changed

corpus/basejump_stl/bsg_async/bsg_async_credit_counter.txt

Lines changed: 1116 additions & 0 deletions
Large diffs are not rendered by default.

corpus/basejump_stl/bsg_async/bsg_async_fifo.txt

Lines changed: 1185 additions & 0 deletions
Large diffs are not rendered by default.

corpus/basejump_stl/bsg_async/bsg_async_ptr_gray.txt

Lines changed: 1127 additions & 0 deletions
Large diffs are not rendered by default.

corpus/basejump_stl/bsg_async/bsg_launch_sync_sync.txt

Lines changed: 352 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
// MBT 7/24/2014
2+
//
3+
// bsg_sync_sync
4+
//
5+
// This is just two synchronization flops.
6+
//
7+
// We use the rp placement flop from synopsys.
8+
// Fixme: move this into asic-specific components.
9+
//
10+
11+
`include "bsg_defines.sv"
12+
13+
`ifndef rp_group
14+
`define rp_group(x)
15+
`define rp_place(x)
16+
`define rp_endgroup(x)
17+
`define rp_fill(x)
18+
`define rp_array_dir(up)
19+
`endif
20+
21+
`define bsg_sync_sync_unit(width_p) \
22+
\
23+
module bsg_sync_sync_``width_p``_unit \
24+
( \
25+
input oclk_i \
26+
, input [width_p-1:0] iclk_data_i \
27+
, output [width_p-1:0] oclk_data_o // after sync flops \
28+
); \
29+
\
30+
\
31+
`rp_group (bss_bank) \
32+
`rp_place (hier bss_1 0 0) \
33+
`rp_place (hier bss_2 1 0) \
34+
`rp_endgroup (bss_bank) \
35+
\
36+
logic [width_p-1:0] bsg_SYNC_1_r; \
37+
logic [width_p-1:0] bsg_SYNC_2_r; \
38+
\
39+
assign oclk_data_o = bsg_SYNC_2_r; \
40+
\
41+
always_ff @(posedge oclk_i) \
42+
begin \
43+
`rp_group(bss_1) \
44+
`rp_fill(0 0 UX) \
45+
`rp_array_dir(up) \
46+
`rp_endgroup(bss_1) \
47+
bsg_SYNC_1_r <= iclk_data_i; \
48+
end \
49+
\
50+
always_ff @(posedge oclk_i) \
51+
begin \
52+
`rp_group(bss_2) \
53+
`rp_fill(0 0 UX) \
54+
`rp_array_dir(up) \
55+
`rp_endgroup(bss_2) \
56+
bsg_SYNC_2_r <= bsg_SYNC_1_r; \
57+
end \
58+
\
59+
endmodule
60+
61+
`bsg_sync_sync_unit(1)
62+
`bsg_sync_sync_unit(2)
63+
`bsg_sync_sync_unit(3)
64+
`bsg_sync_sync_unit(4)
65+
`bsg_sync_sync_unit(5)
66+
`bsg_sync_sync_unit(6)
67+
`bsg_sync_sync_unit(7)
68+
`bsg_sync_sync_unit(8)
69+
70+
// warning: if you make this != 8, you need to modify other
71+
// parts of this code.
72+
73+
`define bss_max_block 8
74+
75+
`define bss_if_clause(num) if ((width_p % `bss_max_block) == num) begin: z\
76+
bsg_sync_sync_``num``_unit bss \
77+
(.oclk_i \
78+
,.iclk_data_i(iclk_data_i[width_p-1-:num]) \
79+
,.oclk_data_o(oclk_data_o[width_p-1-:num]) \
80+
); end
81+
82+
83+
module bsg_sync_sync #(parameter `BSG_INV_PARAM(width_p ))
84+
(
85+
input oclk_i
86+
, input [width_p-1:0] iclk_data_i
87+
, output [width_p-1:0] oclk_data_o // after sync flops
88+
);
89+
90+
genvar i;
91+
92+
`ifndef BSG_HIDE_FROM_SYNTHESIS
93+
/*
94+
initial
95+
begin
96+
$display("%m: instantiating bss of size %d",width_p);
97+
end
98+
*/
99+
`endif
100+
101+
for (i = 0; i < (width_p/`bss_max_block); i = i + 1)
102+
begin : maxb
103+
bsg_sync_sync_8_unit bss8
104+
(.oclk_i
105+
,.iclk_data_i(iclk_data_i[i*`bss_max_block+:`bss_max_block])
106+
,.oclk_data_o(oclk_data_o[i*`bss_max_block+:`bss_max_block])
107+
);
108+
end
109+
110+
`bss_if_clause(1) else
111+
`bss_if_clause(2) else
112+
`bss_if_clause(3) else
113+
`bss_if_clause(4) else
114+
`bss_if_clause(5) else
115+
`bss_if_clause(6) else
116+
`bss_if_clause(7)
117+
118+
endmodule
119+
120+
`BSG_ABSTRACT_MODULE(bsg_sync_sync)

0 commit comments

Comments
 (0)