Uso el comando "forzar" en modelsim para forzar una señal interna a un valor específico (no entradas primarias). A veces, el valor que fuerzo es el mismo que el valor original.
¿Hay algún comando que pueda cambiar el valor de la señal en modelsim o cualquier otro simulador de verilog? En ese caso, definitivamente cambiaré el valor de la señal.
No hay comandos de simulador que yo sepa para invertir una señal. Sin embargo, si está haciendo la fuerza desde dentro de la fuente de Verilog, simplemente debería poder hacer esto:
force path.to.signal = ~path.to.signal;
Si lo está forzando desde el simulador, probablemente pueda hacer el equivalente de la declaración anterior en TCL. Necesitaría obtener el valor actual, invertirlo y luego aplicar una fuerza con el valor invertido.
En ModelSim el comando para forzar una señal es:
force signal_name value time
Por ejemplo:
force reset 0 100
O si desea una forma más avanzada de hacerlo, suponiendo que su tiempo esté configurado en 1 ns:
force clk 0 20, 1 20 -repeat 100
Puede obtener más información si lee el manual: ModelSim SE Command Reference
Aquí está el extracto de ese archivo:
force input1 0
Forces input1 to 0 at the current simulator time.
force bus1 01XZ 100 ns
Forces bus1 to 01XZ at 100 nanoseconds after the current simulator time.
force bus1 16#f @200
Forces bus1 to 16#F at the absolute time 200 measured in the resolution units selected at simulation start-up.
force input1 1 10, 0 20 -r 100
Forces input1 to 1 at 10 time units after the current simulation time and to 0 at 20 time units after the current simulation time. This cycle repeats starting at 100 time units after the current simulation time, so the next transition is to 1 at 100 time units after the current simulation time.
force input1 1 10 ns, 0 {20 ns} -r 100ns
Similar to the previous example, but also
specifies the time units. Time unit expressions
preceding the "-r" must be placed in curly braces.
**force s 1 0, 0 100 -repeat 200 -cancel 1000**
Forces signals to alternate between values 1 and 0 every 100 time units until time 1000.
Cancellation occurs at the last simulation delta cycle of a time unit. So,
force s 1 0 -cancel 0
will force signals to 1 for the duration of the current time period.
when {/mydut/siga = 10#1}
{
force -deposit /mydut/siga 10#85
}
Forces siga to decimal value 85 whenever the value on the signal is 1.
FarhadA
drdot
martin thompson
drdot
martin thompson