Ich verwende den Befehl "Force" in Modelsim, um ein internes Signal auf einen bestimmten Wert zu zwingen (nicht primäre Eingänge). Manchmal ist der von mir erzwungene Wert derselbe wie der ursprüngliche Wert.
Gibt es einen Befehl, der den Signalwert in Modelsim oder anderen Verilog-Simulatoren umdrehen kann? In diesem Fall werde ich definitiv den Wert des Signals ändern.
Mir sind keine Simulatorbefehle zum Invertieren eines Signals bekannt. Wenn Sie die Kraft jedoch aus der Verilog-Quelle heraus ausführen, sollten Sie dies einfach tun können:
force path.to.signal = ~path.to.signal;
Wenn Sie es vom Simulator aus erzwingen, können Sie wahrscheinlich das Äquivalent der obigen Anweisung in TCL ausführen. Sie müssten den aktuellen Wert abrufen, ihn invertieren und dann eine Kraft mit dem invertierten Wert anwenden.
In ModelSim lautet der Befehl zum Erzwingen eines Signals:
force signal_name value time
Zum Beispiel:
force reset 0 100
Oder wenn Sie eine fortgeschrittenere Methode wünschen, vorausgesetzt, Ihre Zeit ist auf 1 ns eingestellt:
force clk 0 20, 1 20 -repeat 100
Sie können mehr erfahren, wenn Sie das Handbuch lesen: ModelSim SE Command Reference
Hier ist der Auszug aus dieser Datei:
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 Thomson
drdot
Martin Thomson