home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1 / HamRadio.cdr / circuit / gatesim / lights.sim < prev    next >
Text File  |  1988-12-23  |  4KB  |  122 lines

  1. $
  2. $ You may stop and continue the simulator demo at any time by pressing the
  3. $ space bar.  Type any other key to interrupt.
  4. $
  5. $ The delay commands are here to allow you to read the comments.
  6. DLay 3000
  7. $
  8. $ GateSim is a gate-level simulator.  It is an event driven simulator that
  9. $ allows for arbitrary gate delays, both low-going and high-going.  The
  10. $ simulator supports four states: 0, 1, X (unknown), and Z (undriven).
  11. $
  12. $ Simulator commands may come from the keyboard for interactive simulation.
  13. $ For repeated simulations, commands may be stored in a file and replayed.
  14. $ For this demo, commands are being read from the file lights.sim.
  15. $
  16. $ The circuit being simulated is a traffic light controller.  The schematic
  17. $ was entered using OrCAD SDT III, using vendor independent cells from our
  18. $ schematic library, SchemLib.  The OrCAD netlist output (EDIF) was converted
  19. $ to simulator input by NetTran using timing from the National Semiconductor
  20. $ gate array mapping library, NSC15GAMap.  Now we read in the netlist file
  21. $ lights.net.
  22. NEtfile LIGHTS
  23. $
  24. DLay 5000
  25. $
  26. $ Simulations run faster if the output is not displayed on the screen but
  27. $ for this demo, we wish to see the output so we turn on the display.
  28. MOnitor ON
  29. DLay 3000  
  30. $
  31. $ Signals that drive the external pins of the circuit are defined in a
  32. $ vector file.  This file may contain 0s and 1s in .PATT statements or 
  33. $ specifications for repeated waveforms using .CLK statements.  For this
  34. $ demo, the inputs consist of a 10MHz clock and a reset line that starts
  35. $ low, goes high after 50nsec and stays high the rest of the simulation.
  36. $
  37. $ At this point, we define the name of the input vector pattern file.  The
  38. $ file is not actually read in until simulation begins.  Default extension is
  39. $ .VEC.
  40. PAttfile LIGHTS
  41. DLay 3000
  42. $
  43. $ When the simulation begins, the display will show the output signals.  We
  44. $ wish to intersperse into the simulation display the input vectors as read
  45. $ from the pattern file, along with any comments in the pattern file.
  46. $ Show the input vectors in the simulator output marked with > character.
  47. VIewvector ON
  48. DLay 3000
  49. $
  50. $ The simulator can display the signal values as 0s and 1s or can show the
  51. $ value of four nodes as a hex digit.  We define TOP to be the top nibble of
  52. $ the 8 bit counter in the traffic controller state machine.
  53. .HEX TOP = RED_EW TOP6 TOP5 TOP4
  54. DLay 3000
  55. $
  56. $ Shift the decimal point so that the time is expressed in nanoseconds
  57. $ because library times are in 1/10ths of nanoseconds.
  58. DP 1 1 1
  59. DLay 3000
  60. $
  61. $ The table statement defines what nodes are to be displayed during the
  62. $ simulation.  Note that the ';' puts a space between lines in the output.
  63. .tab RESET* ; CLOCK ; WALK_NS DONT_NS GREEN_NS YELLOW_NS RED_NS ;
  64. + WALK_EW DONT_EW GREEN_EW YELLOW_EW RED_EW
  65. DLay 3000
  66. $
  67. $ Simulate from 0 to 5.0000 us.
  68. DLay 3000
  69. SImulate 0 50000
  70. $
  71. $ Woops!  We forgot to include the nibble TOP in the .TAB statement.  We can
  72. $ change the list of nodes we are watching right now in the middle of a
  73. $ simulation.  The '+' signifies adding nodes to the existing list.
  74. .tab + ; TOP
  75. DLay 3000
  76. $
  77. $ Simulate some more.
  78. DLay 3000
  79. SImulate +
  80. $
  81. $ Turn on horizontal scrolling.
  82. HOrizontal ON
  83. DLay 3000
  84. $ Simulate some more.
  85. DLay 3000
  86. SImulate +
  87. $
  88. $ Turn on the waveform output.
  89. WAveform ON
  90. DLay 3000
  91. $ Simulate some more.
  92. DLay 3000
  93. SImulate +
  94. $ So far we have been viewing simulator output for every event with times
  95. $ in between compressed.  Now we switch to sampled display with the STEP
  96. $ specification.  Timing is displayed evenly but we may not see glitches.
  97. $
  98. DLay 10000
  99. SImulate 200000 382500 STEP 500
  100. $
  101. $ Decrease the sampling time step to catch the glitch again.
  102. DLay 3000
  103. SImulate 382900 384310 STEP 10
  104. $
  105. FOrcenode Vdd T    $Power nodes do not need to be tested.
  106. FOrcenode Gnd T
  107. DLay 3000
  108. $
  109. $ Now do a fault simulation.  Default extension is .CMP.
  110. DLay 3000
  111. FSim 0 140000 -c lights
  112. $
  113. $ Find the paths and delays between the TEST POINT and DONT_NS.
  114. DLay 3000
  115. NDelay TEST_POINT DONT_NS -c100
  116. $
  117. $ Quit.
  118. DLay 3000
  119. QUit
  120.