Commits

Christopher Felton  committed 4a2b246

added a print, see it doing something

  • Participants
  • Parent commits d446086

Comments (0)

Files changed (1)

File cosim/example1/cosim_inputs_only.py

 
     return hdl    
     
-def test(tb_dut,clock,reset):
+def test(tb_dut,clock,reset,v):
     tb_clk = clock.gen()
     @instance
     def tb_stim():
         yield reset.pulse(10)
-        while now() < 95:
-            yield delay(10)        
+        while now() < 23:
+            yield clock.posedge
+            print(v)
         raise StopSimulation
 
     Simulation((tb_dut,tb_clk,tb_stim)).run()
 def run_test(f='i'):
     assert f in ('i','o'), "Incorrect option, must be 'i' or 'o'"
     msg = {'i':'inputs','o':'inputs and outputs'}
-    clock,reset = (Clock(0), Reset(0,active=0,async=True))
+    clock,reset = (Clock(0), Reset(0,active=1,async=False))
     v = Signal(modbv(0)[3:])
     print('%s'%f+'-'*48)
     if f == 'i':
         tb_dut = cosim_icarus(m_inputs_outputs,clock=clock,reset=reset,v=v)
 
     try:
-        test(tb_dut,clock,reset)
+        test(tb_dut,clock,reset,v)
     except:
         print('%s cosimulation failed'%(msg[f]))
         traceback.print_exc()
 if __name__ == '__main__':
     parser = argparse.ArgumentParser(description='test a cosim config')
     parser.add_argument('f', type=str, choices=('i','o'),
-                        help='test inputs only (i) or inputs and outputs to cosim')
+                        help='test inputs only (i) or inputs and outputs (o) to cosim')
     args = parser.parse_args()
     run_test(args.f)