Академический Документы
Профессиональный Документы
Культура Документы
carsten@wulff.no
systemdotnet
2004-09-13
Norwegian University of Science and Technology (NTNU), Departement of Physical Electronics
SystemDotNet
What is discrete time simulation
carsten@wulff.no
– Event Queue: Schedules changes for signals
– Module: Logical collection of signals and
processes
carsten@wulff.no
Norwegian University of Science and Technology (NTNU), Departement of Physical Electronics
SystemDotNet
SystemDotNet Overview
Event queue and
simulator control
Modules
Output writers
Signals
carsten@wulff.no
Norwegian University of Science and Technology (NTNU), Departement of Physical Electronics
SystemDotNet
Divide and Conquer
carsten@wulff.no
• The Modules
In SystemDotNet
Run Events
20ns 20ns
carsten@wulff.no
30ns 30ns 30ns
if (!queue.ContainsKey(key))
carsten@wulff.no
queue.Add(key, new List<IRunnable>());
queue[key].Add(ite);
}
carsten@wulff.no
No
Remove events from the queue and
execute them
carsten@wulff.no
Norwegian University of Science and Technology (NTNU), Departement of Physical Electronics
SystemDotNet
The Simulator
carsten@wulff.no
Norwegian University of Science and Technology (NTNU), Departement of Physical Electronics
SystemDotNet
The Signals
carsten@wulff.no
• SignalCollection<Type>: Dynamic collection
of signals that can be used instead of
Signal<Type> array.
Norwegian University of Science and Technology (NTNU), Departement of Physical Electronics
SystemDotNet
SignalBase.SensitiveType
carsten@wulff.no
the signal content you should override Object.Equals
to determine if two objects are the same.
• Extend SignalBase
• Implement ISignal
• Override ToString()
• Implement AddListener and
carsten@wulff.no
RemoveListener
• Add Read and Write methods
carsten@wulff.no
internal override void AddListener(SignalBase c)
{
((Signal<T>)c).Wire.ValueUpdated += delegate(SignalValueHolder<T> sender) { this.Wire.Value =
sender.Value; };
}
carsten@wulff.no
//Add it to the event queue
Simulator.GetInstance().Write(te, delay);
}
carsten@wulff.no
}
carsten@wulff.no
public void Next()
{
Clk.Write(!Clk.Read(), 200);
}
}
carsten@wulff.no
simulator
• OnStop(): Called when the simulator stops
carsten@wulff.no
attribute and compares it to the signals in the
module. If they match it adds the method to
the Changed event of the signal
Norwegian University of Science and Technology (NTNU), Departement of Physical Electronics
SystemDotNet
Code run through of
SdnReferenceDesign
carsten@wulff.no
Norwegian University of Science and Technology (NTNU), Departement of Physical Electronics