-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow passing in of enviroment into comb and seq
- Loading branch information
Showing
10 changed files
with
227 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{"top":"global.TestBasic", | ||
"namespaces":{ | ||
"global":{ | ||
"modules":{ | ||
"TestBasic":{ | ||
"type":["Record",[ | ||
["I",["Array",2,"BitIn"]], | ||
["CLK",["Named","coreir.clkIn"]], | ||
["ASYNCRESET",["Named","coreir.arstIn"]], | ||
["O",["Array",2,"Bit"]] | ||
]], | ||
"instances":{ | ||
"TestBasic_comb_inst0":{ | ||
"modref":"global.TestBasic_comb" | ||
}, | ||
"reg_PR_inst0":{ | ||
"genref":"coreir.reg_arst", | ||
"genargs":{"width":["Int",2]}, | ||
"modargs":{"arst_posedge":["Bool",true], "clk_posedge":["Bool",true], "init":[["BitVector",2],"2'h2"]} | ||
}, | ||
"reg_PR_inst1":{ | ||
"genref":"coreir.reg_arst", | ||
"genargs":{"width":["Int",2]}, | ||
"modargs":{"arst_posedge":["Bool",true], "clk_posedge":["Bool",true], "init":[["BitVector",2],"2'h0"]} | ||
} | ||
}, | ||
"connections":[ | ||
["self.I","TestBasic_comb_inst0.I"], | ||
["reg_PR_inst0.in","TestBasic_comb_inst0.O0"], | ||
["reg_PR_inst1.in","TestBasic_comb_inst0.O1"], | ||
["self.O","TestBasic_comb_inst0.O2"], | ||
["reg_PR_inst0.out","TestBasic_comb_inst0.self_x_O"], | ||
["reg_PR_inst1.out","TestBasic_comb_inst0.self_y_O"], | ||
["self.ASYNCRESET","reg_PR_inst0.arst"], | ||
["self.CLK","reg_PR_inst0.clk"], | ||
["self.ASYNCRESET","reg_PR_inst1.arst"], | ||
["self.CLK","reg_PR_inst1.clk"] | ||
] | ||
}, | ||
"TestBasic_comb":{ | ||
"type":["Record",[ | ||
["I",["Array",2,"BitIn"]], | ||
["self_x_O",["Array",2,"BitIn"]], | ||
["self_y_O",["Array",2,"BitIn"]], | ||
["O0",["Array",2,"Bit"]], | ||
["O1",["Array",2,"Bit"]], | ||
["O2",["Array",2,"Bit"]] | ||
]], | ||
"connections":[ | ||
["self.O0","self.I"], | ||
["self.self_x_O","self.O1"], | ||
["self.self_y_O","self.O2"] | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module coreir_reg_arst #(parameter width = 1, parameter arst_posedge = 1, parameter clk_posedge = 1, parameter init = 1) (input clk, input arst, input [width-1:0] in, output [width-1:0] out); | ||
reg [width-1:0] outReg; | ||
wire real_rst; | ||
assign real_rst = arst_posedge ? arst : ~arst; | ||
wire real_clk; | ||
assign real_clk = clk_posedge ? clk : ~clk; | ||
always @(posedge real_clk, posedge real_rst) begin | ||
if (real_rst) outReg <= init; | ||
else outReg <= in; | ||
end | ||
assign out = outReg; | ||
endmodule | ||
|
||
module TestBasic_comb (input [1:0] I, output [1:0] O0, output [1:0] O1, output [1:0] O2, input [1:0] self_x_O, input [1:0] self_y_O); | ||
assign O0 = I; | ||
assign O1 = self_x_O; | ||
assign O2 = self_y_O; | ||
endmodule | ||
|
||
module TestBasic (input ASYNCRESET, input CLK, input [1:0] I, output [1:0] O); | ||
wire [1:0] TestBasic_comb_inst0_O0; | ||
wire [1:0] TestBasic_comb_inst0_O1; | ||
wire [1:0] TestBasic_comb_inst0_O2; | ||
wire [1:0] reg_PR_inst0_out; | ||
wire [1:0] reg_PR_inst1_out; | ||
TestBasic_comb TestBasic_comb_inst0(.I(I), .O0(TestBasic_comb_inst0_O0), .O1(TestBasic_comb_inst0_O1), .O2(TestBasic_comb_inst0_O2), .self_x_O(reg_PR_inst0_out), .self_y_O(reg_PR_inst1_out)); | ||
coreir_reg_arst #(.arst_posedge(1), .clk_posedge(1), .init(2'h2), .width(2)) reg_PR_inst0(.arst(ASYNCRESET), .clk(CLK), .in(TestBasic_comb_inst0_O0), .out(reg_PR_inst0_out)); | ||
coreir_reg_arst #(.arst_posedge(1), .clk_posedge(1), .init(2'h0), .width(2)) reg_PR_inst1(.arst(ASYNCRESET), .clk(CLK), .in(TestBasic_comb_inst0_O1), .out(reg_PR_inst1_out)); | ||
assign O = TestBasic_comb_inst0_O2; | ||
endmodule | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{"top":"global.basic_fun", | ||
"namespaces":{ | ||
"global":{ | ||
"modules":{ | ||
"Mux2":{ | ||
"type":["Record",[ | ||
["I0","BitIn"], | ||
["I1","BitIn"], | ||
["S","BitIn"], | ||
["O","Bit"] | ||
]] | ||
}, | ||
"basic_fun":{ | ||
"type":["Record",[ | ||
["I","BitIn"], | ||
["S","BitIn"], | ||
["O","Bit"] | ||
]], | ||
"instances":{ | ||
"Mux2_inst0":{ | ||
"modref":"global.Mux2" | ||
}, | ||
"bit_const_0_None":{ | ||
"modref":"corebit.const", | ||
"modargs":{"value":["Bool",false]} | ||
} | ||
}, | ||
"connections":[ | ||
["bit_const_0_None.out","Mux2_inst0.I0"], | ||
["self.I","Mux2_inst0.I1"], | ||
["self.O","Mux2_inst0.O"], | ||
["self.S","Mux2_inst0.S"] | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module basic_fun (input I, input S, output O); | ||
wire Mux2_inst0_O; | ||
Mux2 Mux2_inst0 (.I0(1'b0), .I1(I), .S(S), .O(Mux2_inst0_O)); | ||
assign O = Mux2_inst0_O; | ||
endmodule | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{"top":"global.basic_fun", | ||
"namespaces":{ | ||
"global":{ | ||
"modules":{ | ||
"Mux2":{ | ||
"type":["Record",[ | ||
["I0","BitIn"], | ||
["I1","BitIn"], | ||
["S","BitIn"], | ||
["O","Bit"] | ||
]] | ||
}, | ||
"basic_fun":{ | ||
"type":["Record",[ | ||
["I","BitIn"], | ||
["S","BitIn"], | ||
["O","Bit"] | ||
]], | ||
"instances":{ | ||
"Mux2_inst0":{ | ||
"modref":"global.Mux2" | ||
}, | ||
"bit_const_1_None":{ | ||
"modref":"corebit.const", | ||
"modargs":{"value":["Bool",true]} | ||
} | ||
}, | ||
"connections":[ | ||
["bit_const_1_None.out","Mux2_inst0.I0"], | ||
["self.I","Mux2_inst0.I1"], | ||
["self.O","Mux2_inst0.O"], | ||
["self.S","Mux2_inst0.S"] | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module basic_fun (input I, input S, output O); | ||
wire Mux2_inst0_O; | ||
Mux2 Mux2_inst0 (.I0(1'b1), .I1(I), .S(S), .O(Mux2_inst0_O)); | ||
assign O = Mux2_inst0_O; | ||
endmodule | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters