-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #839 from rdaly525/order-ports
Preserve port order in module instantiation
- Loading branch information
Showing
13 changed files
with
228 additions
and
102 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ matrix: | |
homebrew: | ||
packages: | ||
- verilator | ||
update: true | ||
before_install: | ||
# install conda for py 3.7 | ||
- | | ||
|
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
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,94 @@ | ||
{"top":"global.test_two_ops", | ||
"namespaces":{ | ||
"global":{ | ||
"modules":{ | ||
"Add8_cin":{ | ||
"type":["Record",[ | ||
["z",["Array",8,"BitIn"]], | ||
["x",["Array",8,"BitIn"]], | ||
["a",["Array",8,"Bit"]], | ||
["CIN","BitIn"] | ||
]], | ||
"instances":{ | ||
"bit_const_0_None":{ | ||
"modref":"corebit.const", | ||
"modargs":{"value":["Bool",false]} | ||
}, | ||
"inst0":{ | ||
"genref":"coreir.add", | ||
"genargs":{"width":["Int",8]} | ||
}, | ||
"inst1":{ | ||
"genref":"coreir.add", | ||
"genargs":{"width":["Int",8]} | ||
} | ||
}, | ||
"connections":[ | ||
["inst1.in0.1","bit_const_0_None.out"], | ||
["inst1.in0.2","bit_const_0_None.out"], | ||
["inst1.in0.3","bit_const_0_None.out"], | ||
["inst1.in0.4","bit_const_0_None.out"], | ||
["inst1.in0.5","bit_const_0_None.out"], | ||
["inst1.in0.6","bit_const_0_None.out"], | ||
["inst1.in0.7","bit_const_0_None.out"], | ||
["inst1.out","inst0.in0"], | ||
["self.x","inst0.in1"], | ||
["self.a","inst0.out"], | ||
["self.CIN","inst1.in0.0"], | ||
["self.z","inst1.in1"] | ||
] | ||
}, | ||
"Sub8":{ | ||
"type":["Record",[ | ||
["z",["Array",8,"BitIn"]], | ||
["x",["Array",8,"BitIn"]], | ||
["a",["Array",8,"Bit"]] | ||
]], | ||
"instances":{ | ||
"bit_const_1_None":{ | ||
"modref":"corebit.const", | ||
"modargs":{"value":["Bool",true]} | ||
}, | ||
"inst0":{ | ||
"genref":"coreir.not", | ||
"genargs":{"width":["Int",8]} | ||
}, | ||
"inst1":{ | ||
"modref":"global.Add8_cin" | ||
} | ||
}, | ||
"connections":[ | ||
["inst1.CIN","bit_const_1_None.out"], | ||
["self.x","inst0.in"], | ||
["inst1.x","inst0.out"], | ||
["self.z","inst1.z"], | ||
["self.a","inst1.a"] | ||
] | ||
}, | ||
"test_two_ops":{ | ||
"type":["Record",[ | ||
["z",["Array",8,"BitIn"]], | ||
["x",["Array",8,"BitIn"]], | ||
["a",["Array",8,"Bit"]] | ||
]], | ||
"instances":{ | ||
"inst0":{ | ||
"genref":"coreir.add", | ||
"genargs":{"width":["Int",8]} | ||
}, | ||
"inst1":{ | ||
"modref":"global.Sub8" | ||
} | ||
}, | ||
"connections":[ | ||
["self.z","inst0.in0"], | ||
["self.x","inst0.in1"], | ||
["inst1.z","inst0.out"], | ||
["self.z","inst1.x"], | ||
["self.a","inst1.a"] | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
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,12 @@ | ||
module Add8_cin (input [7:0] z, input [7:0] x, output [7:0] a, input CIN); | ||
assign a = (({1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,1'b0,CIN}) + z) + x; | ||
endmodule | ||
|
||
module Sub8 (input [7:0] z, input [7:0] x, output [7:0] a); | ||
Add8_cin inst1(.z(z), .x(~ x), .a(a), .CIN(1'b1)); | ||
endmodule | ||
|
||
module test_two_ops (input [7:0] z, input [7:0] x, output [7:0] a); | ||
Sub8 inst1(.z(z + x), .x(z), .a(a)); | ||
endmodule | ||
|
Oops, something went wrong.