Skip to content

Commit

Permalink
Test bit mux inline
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardt committed Jan 13, 2020
1 parent 134eea6 commit 6cb5980
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
53 changes: 53 additions & 0 deletions tests/gtest/two_ops_bit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{"top":"global.Top",
"namespaces":{
"global":{
"modules":{
"Top":{
"type":["Record",[
["I","BitIn"],
["I1","BitIn"],
["I2","BitIn"],
["I3","BitIn"],
["O","Bit"],
["O1","Bit"]
]],
"instances":{
"bit_const_1_None":{
"modref":"corebit.const",
"modargs":{"value":["Bool",true]}
},
"magma_Bit_and_inst0":{
"modref":"corebit.and"
},
"magma_Bit_not_inst0":{
"modref":"corebit.not"
},
"magma_Bit_or_inst0":{
"modref":"corebit.or"
},
"magma_Bit_xor_inst0":{
"modref":"corebit.xor"
},
"test_mux":{
"modref":"corebit.mux"
}
},
"connections":[
["magma_Bit_and_inst0.in1","bit_const_1_None.out"],
["magma_Bit_not_inst0.out","magma_Bit_and_inst0.in0"],
["magma_Bit_or_inst0.in1","magma_Bit_and_inst0.out"],
["self.I","magma_Bit_not_inst0.in"],
["magma_Bit_xor_inst0.out","magma_Bit_or_inst0.in0"],
["self.O","magma_Bit_or_inst0.out"],
["self.I","magma_Bit_xor_inst0.in0"],
["self.I","magma_Bit_xor_inst0.in1"],
["self.I1","test_mux.in0"],
["self.I2","test_mux.in1"],
["self.I3","test_mux.sel"],
["self.O1","test_mux.out"]
]
}
}
}
}
}
5 changes: 5 additions & 0 deletions tests/gtest/two_ops_bit_golden.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module Top (input I, input I1, input I2, input I3, output O, output O1);
assign O = (I ^ I) | ((~ I) & 1'b1);
assign O1 = I3 ? I2 : I1;
endmodule

0 comments on commit 6cb5980

Please sign in to comment.