home *** CD-ROM | disk | FTP | other *** search
- "$ Revision: 1.0 $"
- "Copyright 1990:
- Jecel Mattos de Assumpcao Jr.
- LSI - EPSUP, Sao Paulo, SP, Brasil"
-
- "Example Components"
-
- "library <examples> cc"
- " a simple combinational circuit "
-
- "library <examples? st"
- " a trivial state machine to test FSMs "
-
- "library <examples> osc"
- " a controlled oscilator to test component vectors "
-
- library examples _DefineSlots: ( |
- cc = ( |
- parent* = traits simulation component.
- sim**.
- dad.
- leaf.
- type = 'combinational circuit test'.
- a. b. c. d. g.
- declare = (
- a: input.
- b: input.
- c: input.
- d: input.
- g: output.
- ).
- behave = ( set: g To: ((a || b) && (c || d)) After: 10 ).
- u1. u2. u3.
- netlist = (
- u1: ( get: library or2 ).
- u2: ( get: library or2 ).
- u3: ( get: library and2 ).
- u1 out to: u3 in1.
- u2 out to: u3 in2.
- u1 in1 to: a.
- u1 in2 to: b.
- u2 in1 to: c.
- u2 in2 to: d.
- u3 out to: g.
- ).
- | ).
- ff = ( |
- parent* = traits simulation component.
- sim**.
- dad.
- leaf.
- type = 'single phase clock latch test'.
- in. phi. out.
- declare = (
- in: input.
- phi: input.
- out: output.
- ).
- latch. inv.
- netlist = (
- latch: ( get: library ocLatch ).
- inv: ( get: library inverter ).
- in to: latch in.
- phi to: latch phi.
- latch out to: inv in.
- inv out to: out.
- ).
- | ).
- st = ( |
- parent* = traits simulation component.
- sim**.
- dad.
- leaf.
- type = 'state machine test'.
- clk. sm. div3.
- declare = (
- clk: input.
- sm: ( fsm initial: 'first' ).
- div3: output.
- ).
- behave = (
- sm onRising: clk Is: [
- state: 'first' Do: [ goto: 'second'.
- set: div3 To: h After: 2 ].
- state: 'second' Do: [ goto: 'third'.
- set: div3 To: l After: 2 ].
- state: 'third' Do: [ goto: 'first' ].
- ].
- ).
- | ).
- osc = ( |
- parent* = traits simulation component.
- sim**.
- dad.
- leaf.
- type = 'controlled oscilator'.
- enable. out.
- declare = (
- enable: input.
- out: input.
- ).
- behave = (
- enable isHigh ifTrue: [
- out isHigh ifTrue: [ set: out To: l After: 12 ]
- False: [ set: out To: h After: 12 ].
- ].
- enable isUnknown ifTrue: [ set: out To: x After: 12 ].
- enable isLow ifTrue: [ set: out To: h After: 12 ].
- ).
- nand. invs.
- netlist = (
- nand: ( get: library nand2 ).
- invs: vector copySize: 6.
- 6 do: [ | :i |
- invs at: i Put: ( get: library inverter ).
- ].
- 1 to: 5 Do: [ | :i |
- ( invs at: i ) in to: ( invs at: i - 1 ) out.
- ].
- ( invs at: 5 ) out to: out.
- nand in1 to: out.
- nand in2 to: enable.
- nand out to: ( invs at: 0 ) in.
- ).
- | ).
- | )
-