Simulation Advancement
仿真器不是按照真实时间推进而进行仿真的, 仿真器是基于event仿真推进,分成以下两个层次:
- time slots
- event
仿真需要处理的最小单位是event, 每个event 都带有自己的timeslot信息,每个timeslots的具体实现就是一个event queue,这个queue里放着这个slots里所有需要处理的events。
仿真是从timeslot 0开始的,首先执行timeslots 0 queue里的events,执行完成以后,执行下一个非空的timeslots queue,以此进行仿真时间推进。
Process
Processes are objects that can be evaluated, that can have state, and that can respond to changes on their inputs to produce outputs.
Processes are concurrently scheduled elements, such as initial procedures. Examples of processes include, but are not limited to
- primitives;
- initial
- always
- always_comb
- always_latch
- always_ff procedures;
- continuous assignments;
- asynchronous tasks;
- procedural assignment statements
Event
在systemverilog有两种类型的event:
- evaluation event (计算处理一些运算)
- update event (系统中net或者variable值的变化)
当update event被执行的时候,会引起net或者variable的变化,所有对这个变化敏感的process都会被触发,这些process重新计算的过程就是evaluation event。