Exemple #1
0
 def testGenerateHier3(self):
     module = g.generate('multi_adder3', {'WIDTH': 8, 'CNT': 10})
     self.assertEqual(module.name, "multi_adder3_CNT10_WIDTH8")
     for i, ins in enumerate(module.getInstances()):
         self.assertEqual(f'{ins.insName}', f'adder_{i}')
         self.assertEqual(ins.module.targetPath, 'build/adder_WIDTH16.v')
         self.assertEqual(ins.module.paramDict['WIDTH'], 16)
         self.assertEqual(ins.module.paramDict['HAS_CIN'], 0)
         self.assertEqual(len(ins.module.IOs), 3)
Exemple #2
0
 def testGenerateHier2(self):
     module = g.generate('multi_adder2', {'WIDTH': 8, 'CNT': 10})
     self.assertEqual(module.name, "multi_adder2_CNT10_WIDTH8")
Exemple #3
0
 def testGenerateBasic(self):
     module = g.generate('adder', {'WIDTH': 16})
     self.assertEqual(module.name, 'adder_WIDTH16')
Exemple #4
0
 def testGenerateBasic(self):
     module = dut.generate('trip_adder', {'WIDTH': 16}, renderType='trip')
     exp = "Module(name='trip_adder_WIDTH16', IOs=[Input('a', 16), Input('b', 16), Output('sum', 17)], paramDict={'HAS_CIN': 0, 'WIDTH': 16}, instanceList=[], userResult=Result(area=16))"
     self.assertEqual(f"{module}", exp)
Exemple #5
0
 def testGenerateHier3(self):
     self.maxDiff = None
     module = dut.generate('multi_adder3', {'WIDTH':8, 'CNT':10})
     self.assertEqual(f"{module}", self.exp("multi_adder3_CNT10_WIDTH8"))
Exemple #6
0
 def testGenerateBasic2(self):
     module = dut.generate('adder2', {'WIDTH':16})
     exp = "Module(name='adder2_WIDTH16', IOs=[Input('a', 16), Input('b', 16), Output('sum', 17)], paramDict={'HAS_CIN': 0, 'WIDTH': 16}, instanceList=[])"
     self.assertEqual(f"{module}", exp)