Digital Signal Generator

The digital signal generator uses simple instructions to generate digital waveforms. It can generate periodic signals such as clock signals, simple set or reset pulse or complex waveforms. To generate reset signals or clock signals, specify values ​​for the parameters: delay, width, period and mode. Complex digital signals must be defined in a tabular format by specifying a value for the parameter input_file.

Digital Source

The digital source provides for straightforward descriptions of digital signal vectors in a tabular format. The model reads input from the input file and, at the times specified in the file, generates the inputs along with the strengths listed.

The format of the input file is as shown below. Note that comment lines are delineated through the use of a single "*" character in the first column of a line.

* T        c    n    n    n  . . .
* i        l    o    o    o  . . .
* m        o    d    d    d  . . .
* e        c    e    e    e  . . .
*          k    a    b    c  . . .

0.0000     Uu   Uu   Us   Uu . . .
1.234e-9   0s   1s   1s   0z . . .
1.376e-9   0s   0s   1s   0z . . .
2.5e-7     1s   0s   1s   0z . . .
2.5006e-7  1s   1s   1s   0z . . .
5.0e-7     0s   1s   1s   0z . . .

Note that in the example shown, whitespace (any combination of blanks, tabs, commas) is used to separate the time and strength/state tokens. The order of the input columns is important; the first column is always interpreted to mean "time". The second through the N'th columns map to the out[0] through out[N-2] output nodes. A non-commented line which does not contain enough tokens to completely define all outputs for the digital_source will cause an error. Also, time values must increase monotonically or an error will result in reading the source file.

Errors will also occur if a line exists in source.txt which is neither a comment nor vector line. The only exception to this is in the case of a line that is completely blank; this is treated as a comment.

Time

The time may be specified in either seconds or clock cycles. Clock cycles are specified by using the '#' prefix (such as #5 specifies 5 clock cycles). The actual time is calculated by multiplying the number of clocks by TIMESTEP value. The TIMESTEP command defines the number of seconds per clock cycle.

Absolute time values must be in ascending order. The time may also be declared relative to the previous time value by placing a '+' character in front of the time, such as +10ns or +#5.

Loops

The REPEAT command specifies the beginning of a loop. All stimulus commands between the REPEAT line and the ENDREPEAT line will be looped the amount of times specified. REPEAT FOREVER creates an infinite loop. All absolute times within the loop are considered relative to the beginning of the loop.

*TIME D0 D1
0s    0s 1s
*
REPEAT FOREVER
  REPEAT 5
    1us  1s 0s
    2us  0s 1s
  ENDREPEAT 
*
  REPEAT 2
    5us  1s 0s
    10us 0s 1s
  ENDREPEAT 
*
  TIMESTEP 1us
  +#1  1s 0s
  +#9  0s 1s
ENDREPEAT

Output Values

Value State Strength
0s, 0, L Low STRONG
1s, 1, H High STRONG
Us, U, X Unknown STRONG
0r Low RESISTIVE
1r High RESISTIVE
Ur Unknown RESISTIVE
0z Low HI_IMPEDANCE
1z High HI_IMPEDANCE
Uz, Z Unknown HI_IMPEDANCE
0u Low UNDETERMINED
1u High UNDETERMINED
Uu Unknown UNDETERMINED

Port Table

Description Direction Default Type Allowed Types Vector Vector Bounds Null Allowed
output OUT d d YES   NO

Parameter Table

Name Description Data Type Default Value Limits Vector Null Allowed
input_file digital input vector filename String     NO YES
delay initial delay Real 0   NO YES
width pulse width Real 0   NO YES
period period Real 0   NO YES
mode 0=low pulse, 1=high pulse Integer 0   NO YES

The parameters: delay, width, period and mode are alternatives to the parameter input_file.

If the filename contains spaces must be delimited by quotation marks. If you do not specify a full path, the file is searched in the following order:

  1. As a file attachment within the current job.
  2. In the folder that contains the current job.
  3. In the folder USER/LIBRARY.
  4. As a file attachment within the jobs in the folder USER/LIBRARY.
  5. In the folder APP/LIBRARY.
  6. As a file attachment within the jobs in the folder APP/LIBRARY.
  7. In the folder APP/BIN.
  8. As a file attachment within the jobs in the folder APP/BIN.
  9. Within the current job. As a block of text defined by Directive #BEGINDATA.
  10. Within the jobs in the folder of the current job. As a block of text defined by Directive #BEGINDATA.
  11. Within the jobs in the folder USER/LIBRARY. As a block of text defined by Directive #BEGINDATA.
  12. Within the jobs in the folder APP/LIBRARY. As a block of text defined by Directive #BEGINDATA.

Error Messages

D_S0URCE: source file 'source.txt' not found.

This message is displayed each time the specified file does not exist.

D_S0URCE: source text was not read successfully.

This message occurs whenever the d_source model has experienced any difficulty in reading the source text. This will occur with any of the following problems:

Example

a3 [2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17] input_vector 
  
.model input_vector d_source(input_file = source.txt)

See also

XSPICE Devices
XSPICE Code Models