Skip to content

Commit 6551b78

Browse files
committed
Update
1 parent dc423dd commit 6551b78

File tree

251 files changed

+5868
-6669
lines changed

Some content is hidden

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

251 files changed

+5868
-6669
lines changed

.DS_Store

6 KB
Binary file not shown.

Makefile

-18
This file was deleted.

example/.DS_Store

6 KB
Binary file not shown.

example/.fir/FullAdder.fir

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
circuit FullAdder :
2+
module FullAdder :
3+
input clock : Clock
4+
input reset : UInt<1>
5+
output io : {flip a : UInt<1>, flip b : UInt<1>, flip cin : UInt<1>, s : UInt<1>, cout : UInt<1>}
6+
7+
node _T = xor(io.a, io.b)
8+
node _T_1 = xor(_T, io.cin)
9+
io.s <= _T_1
10+
node _T_2 = and(io.a, io.b)
11+
node _T_3 = and(io.a, io.cin)
12+
node _T_4 = or(_T_2, _T_3)
13+
node _T_5 = and(io.b, io.cin)
14+
node _T_6 = or(_T_4, _T_5)
15+
io.cout <= _T_6

example/.fir/FullAdder.fir.v

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module FullAdder(
2+
input clock,
3+
input reset,
4+
input io_a,
5+
input io_b,
6+
input io_cin,
7+
output io_s,
8+
output io_cout
9+
);
10+
wire _T;
11+
wire _T_2;
12+
wire _T_3;
13+
wire _T_4;
14+
wire _T_5;
15+
assign _T = io_a ^ io_b;
16+
assign _T_2 = io_a & io_b;
17+
assign _T_3 = io_a & io_cin;
18+
assign _T_4 = _T_2 | _T_3;
19+
assign _T_5 = io_b & io_cin;
20+
assign io_s = _T ^ io_cin;
21+
assign io_cout = _T_4 | _T_5;
22+
endmodule

example/.fir/PC.fir

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
circuit PC :
2+
module PC :
3+
input clock : Clock
4+
input reset : UInt<1>
5+
output io : {flip pc_in : UInt<32>, pc_out : UInt<32>}
6+
7+
reg pc : UInt<32>, clock with :
8+
reset => (reset, UInt<32>("h0"))
9+
pc <= io.pc_in
10+
io.pc_out <= pc

example/.fir/PC.fir.v

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
module PC(
2+
input clock,
3+
input reset,
4+
input [31:0] io_pc_in,
5+
output [31:0] io_pc_out
6+
);
7+
reg [31:0] pc;
8+
reg [31:0] _RAND_0;
9+
assign io_pc_out = pc;
10+
`ifdef RANDOMIZE_GARBAGE_ASSIGN
11+
`define RANDOMIZE
12+
`endif
13+
`ifdef RANDOMIZE_INVALID_ASSIGN
14+
`define RANDOMIZE
15+
`endif
16+
`ifdef RANDOMIZE_REG_INIT
17+
`define RANDOMIZE
18+
`endif
19+
`ifdef RANDOMIZE_MEM_INIT
20+
`define RANDOMIZE
21+
`endif
22+
`ifndef RANDOM
23+
`define RANDOM $random
24+
`endif
25+
`ifdef RANDOMIZE_MEM_INIT
26+
integer initvar;
27+
`endif
28+
`ifndef SYNTHESIS
29+
initial begin
30+
`ifdef RANDOMIZE
31+
`ifdef INIT_RANDOM
32+
`INIT_RANDOM
33+
`endif
34+
`ifndef VERILATOR
35+
`ifdef RANDOMIZE_DELAY
36+
#`RANDOMIZE_DELAY begin end
37+
`else
38+
#0.002 begin end
39+
`endif
40+
`endif
41+
`ifdef RANDOMIZE_REG_INIT
42+
_RAND_0 = {1{`RANDOM}};
43+
pc = _RAND_0[31:0];
44+
`endif // RANDOMIZE_REG_INIT
45+
`endif // RANDOMIZE
46+
end // initial
47+
`endif // SYNTHESIS
48+
always @(posedge clock) begin
49+
if (reset) begin
50+
pc <= 32'h0;
51+
end else begin
52+
pc <= io_pc_in;
53+
end
54+
end
55+
endmodule

example/.fir/filter.fir

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
circuit MyManyDynamicElementVecFir :
2+
module MyManyDynamicElementVecFir :
3+
input clock : Clock
4+
input reset : UInt<1>
5+
output io : {flip i : UInt<8>, flip valid : UInt<1>, o : UInt<8>}
6+
7+
reg _T : UInt<8>, clock with :
8+
reset => (reset, UInt<8>("h0"))
9+
when io.valid :
10+
_T <= io.i
11+
reg _T_1 : UInt<8>, clock with :
12+
reset => (reset, UInt<8>("h0"))
13+
when io.valid :
14+
_T_1 <= _T
15+
reg a : UInt<8>, clock with :
16+
reset => (reset, UInt<8>("h0"))
17+
when io.valid :
18+
a <= _T_1
19+
reg b : UInt<8>, clock with :
20+
reset => (reset, UInt<8>("h0"))
21+
when io.valid :
22+
b <= a
23+
node _T_2 = mul(io.i, UInt<1>("h0"))
24+
node _T_3 = mul(_T, UInt<1>("h1"))
25+
node _T_4 = add(_T_2, _T_3)
26+
node _T_5 = mul(_T_1, UInt<2>("h2"))
27+
node _T_6 = add(_T_4, _T_5)
28+
node _T_7 = mul(a, UInt<2>("h3"))
29+
node _T_8 = add(_T_6, _T_7)
30+
io.o <= bits(_T_8, 7, 0)

example/.fir/filter.fir.v

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
module MyManyDynamicElementVecFir(
2+
input clock,
3+
input reset,
4+
input [7:0] io_i,
5+
input io_valid,
6+
output [7:0] io_o
7+
);
8+
reg [7:0] _T;
9+
reg [31:0] _RAND_0;
10+
reg [7:0] _T_1;
11+
reg [31:0] _RAND_1;
12+
reg [7:0] a;
13+
reg [31:0] _RAND_2;
14+
wire [8:0] _T_2;
15+
wire [8:0] _T_3;
16+
wire [9:0] _T_4;
17+
wire [9:0] _T_5;
18+
wire [10:0] _T_6;
19+
wire [9:0] _T_7;
20+
wire [10:0] _GEN_4;
21+
wire [11:0] _T_8;
22+
assign _T_2 = io_i * 8'h0;
23+
assign _T_3 = _T * 8'h1;
24+
assign _T_4 = _T_2 + _T_3;
25+
assign _T_5 = _T_1 * 8'h2;
26+
assign _T_6 = _T_4 + _T_5;
27+
assign _T_7 = a * 8'h3;
28+
assign _GEN_4 = {{1'd0}, _T_7};
29+
assign _T_8 = _T_6 + _GEN_4;
30+
assign io_o = _T_8[7:0];
31+
`ifdef RANDOMIZE_GARBAGE_ASSIGN
32+
`define RANDOMIZE
33+
`endif
34+
`ifdef RANDOMIZE_INVALID_ASSIGN
35+
`define RANDOMIZE
36+
`endif
37+
`ifdef RANDOMIZE_REG_INIT
38+
`define RANDOMIZE
39+
`endif
40+
`ifdef RANDOMIZE_MEM_INIT
41+
`define RANDOMIZE
42+
`endif
43+
`ifndef RANDOM
44+
`define RANDOM $random
45+
`endif
46+
`ifdef RANDOMIZE_MEM_INIT
47+
integer initvar;
48+
`endif
49+
`ifndef SYNTHESIS
50+
initial begin
51+
`ifdef RANDOMIZE
52+
`ifdef INIT_RANDOM
53+
`INIT_RANDOM
54+
`endif
55+
`ifndef VERILATOR
56+
`ifdef RANDOMIZE_DELAY
57+
#`RANDOMIZE_DELAY begin end
58+
`else
59+
#0.002 begin end
60+
`endif
61+
`endif
62+
`ifdef RANDOMIZE_REG_INIT
63+
_RAND_0 = {1{`RANDOM}};
64+
_T = _RAND_0[7:0];
65+
`endif // RANDOMIZE_REG_INIT
66+
`ifdef RANDOMIZE_REG_INIT
67+
_RAND_1 = {1{`RANDOM}};
68+
_T_1 = _RAND_1[7:0];
69+
`endif // RANDOMIZE_REG_INIT
70+
`ifdef RANDOMIZE_REG_INIT
71+
_RAND_2 = {1{`RANDOM}};
72+
a = _RAND_2[7:0];
73+
`endif // RANDOMIZE_REG_INIT
74+
`endif // RANDOMIZE
75+
end // initial
76+
`endif // SYNTHESIS
77+
always @(posedge clock) begin
78+
if (reset) begin
79+
_T <= 8'h0;
80+
end else if (io_valid) begin
81+
_T <= io_i;
82+
end
83+
if (reset) begin
84+
_T_1 <= 8'h0;
85+
end else if (io_valid) begin
86+
_T_1 <= _T;
87+
end
88+
if (reset) begin
89+
a <= 8'h0;
90+
end else if (io_valid) begin
91+
a <= _T_1;
92+
end
93+
end
94+
endmodule

example/.fir/test.fir

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
circuit Test :
2+
module Test :
3+
input clock : Clock
4+
input reset : UInt<1>
5+
output io : {DIO_stop : UInt<1>, Jotaro_stop : UInt<1>}
6+
7+
reg counter : UInt<32>, clock with :
8+
reset => (reset, UInt<32>("h0"))
9+
node _T = add(counter, UInt<1>("h1"))
10+
counter <= _T
11+
node _T_1 = eq(counter, UInt<4>("ha"))
12+
reg DIO_stop_r : UInt<1>, clock with :
13+
reset => (reset, UInt<1>("h1"))
14+
when _T_1 :
15+
io.DIO_stop <= UInt<1>("h0")
16+
DIO_stop_r <= UInt<1>("h0")
17+
else :
18+
io.DIO_stop <= DIO_stop_r
19+
node _T_2 = eq(io.DIO_stop, UInt<1>("h0"))
20+
reg Jotaro_stop_r : UInt<1>, clock with :
21+
reset => (reset, UInt<1>("h0"))
22+
when _T_2 :
23+
io.Jotaro_stop <= UInt<1>("h1")
24+
Jotaro_stop_r <= UInt<1>("h1")
25+
else :
26+
io.Jotaro_stop <= Jotaro_stop_r

example/.fir/test.fir.v

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
module Test(
2+
input clock,
3+
input reset,
4+
output io_DIO_stop,
5+
output io_Jotaro_stop
6+
);
7+
reg [31:0] counter;
8+
reg [31:0] _RAND_0;
9+
wire [32:0] _T;
10+
wire _T_1;
11+
reg DIO_stop_r;
12+
reg [31:0] _RAND_1;
13+
wire _GEN_0;
14+
wire _T_2;
15+
reg Jotaro_stop_r;
16+
reg [31:0] _RAND_2;
17+
wire _GEN_2;
18+
assign _T = counter + 32'h1;
19+
assign _T_1 = counter == 32'ha;
20+
assign _GEN_0 = _T_1 ? 1'h0 : DIO_stop_r;
21+
assign _T_2 = io_DIO_stop == 1'h0;
22+
assign _GEN_2 = _T_2 | Jotaro_stop_r;
23+
assign io_DIO_stop = _T_1 ? 1'h0 : DIO_stop_r;
24+
assign io_Jotaro_stop = _T_2 | Jotaro_stop_r;
25+
`ifdef RANDOMIZE_GARBAGE_ASSIGN
26+
`define RANDOMIZE
27+
`endif
28+
`ifdef RANDOMIZE_INVALID_ASSIGN
29+
`define RANDOMIZE
30+
`endif
31+
`ifdef RANDOMIZE_REG_INIT
32+
`define RANDOMIZE
33+
`endif
34+
`ifdef RANDOMIZE_MEM_INIT
35+
`define RANDOMIZE
36+
`endif
37+
`ifndef RANDOM
38+
`define RANDOM $random
39+
`endif
40+
`ifdef RANDOMIZE_MEM_INIT
41+
integer initvar;
42+
`endif
43+
`ifndef SYNTHESIS
44+
initial begin
45+
`ifdef RANDOMIZE
46+
`ifdef INIT_RANDOM
47+
`INIT_RANDOM
48+
`endif
49+
`ifndef VERILATOR
50+
`ifdef RANDOMIZE_DELAY
51+
#`RANDOMIZE_DELAY begin end
52+
`else
53+
#0.002 begin end
54+
`endif
55+
`endif
56+
`ifdef RANDOMIZE_REG_INIT
57+
_RAND_0 = {1{`RANDOM}};
58+
counter = _RAND_0[31:0];
59+
`endif // RANDOMIZE_REG_INIT
60+
`ifdef RANDOMIZE_REG_INIT
61+
_RAND_1 = {1{`RANDOM}};
62+
DIO_stop_r = _RAND_1[0:0];
63+
`endif // RANDOMIZE_REG_INIT
64+
`ifdef RANDOMIZE_REG_INIT
65+
_RAND_2 = {1{`RANDOM}};
66+
Jotaro_stop_r = _RAND_2[0:0];
67+
`endif // RANDOMIZE_REG_INIT
68+
`endif // RANDOMIZE
69+
end // initial
70+
`endif // SYNTHESIS
71+
always @(posedge clock) begin
72+
if (reset) begin
73+
counter <= 32'h0;
74+
end else begin
75+
counter <= _T[31:0];
76+
end
77+
DIO_stop_r <= reset | _GEN_0;
78+
if (reset) begin
79+
Jotaro_stop_r <= 1'h0;
80+
end else begin
81+
Jotaro_stop_r <= _GEN_2;
82+
end
83+
end
84+
endmodule

0 commit comments

Comments
 (0)