mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-08-22 13:57:18 +02:00
Remove some uneccessary zero-time waits from VHDL outputs
This patch optimises away straight line sequences like: wait for 0 ns; wait for X ns; to: wait for X ns; This tidies up the output a bit. It also has the effect of removing all code from initial processes where the assignments have been extracted as VHDL signal intialisers. (c.f. pr2391337)
This commit is contained in:
committed by
Stephen Williams
parent
712e08ebe8
commit
651d208451
+9
-4
@@ -56,10 +56,15 @@ static int generate_vhdl_process(vhdl_entity *ent, ivl_process_t proc)
|
||||
// However, if no statements were added to the container
|
||||
// by draw_stmt, don't bother adding a wait as `emit'
|
||||
// will optimise the process out of the output
|
||||
if (ivl_process_type(proc) == IVL_PR_INITIAL
|
||||
&& !vhdl_proc->get_container()->empty()) {
|
||||
vhdl_wait_stmt *wait = new vhdl_wait_stmt();
|
||||
vhdl_proc->get_container()->add_stmt(wait);
|
||||
if (ivl_process_type(proc) == IVL_PR_INITIAL) {
|
||||
// Get rid of any useless `wait for 0 ns's at the end of the process
|
||||
prune_wait_for_0(vhdl_proc->get_container());
|
||||
|
||||
// The above pruning might have removed all logic from the process
|
||||
if (!vhdl_proc->get_container()->empty()) {
|
||||
vhdl_wait_stmt *wait = new vhdl_wait_stmt();
|
||||
vhdl_proc->get_container()->add_stmt(wait);
|
||||
}
|
||||
}
|
||||
|
||||
// Add a comment indicating where it came from
|
||||
|
||||
Reference in New Issue
Block a user