- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
SystemVerilog LRM (1800-2012):
--- Quote Start --- A final procedure executes when simulation ends due to an explicit or implicit call to $finish. --- Quote End --- But the final block does not execute in ModelSim Altera Starter Edition 10.1e:cry: I used the following code:
module test();
initial begin
# 1 $display("Simulation has been started");
# 1 $finish;
end
final
$display("This should be shown at the end");
endmodule
and this is the output: # Simulation has been started# ** Note: $finish : C:/.../final_bug.sv(4)# Time: 2 ns Iteration: 0 Instance: /test
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you running this code interactively? If so, $finish may be behaving like $stop.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
By "interactively" you mean by using the ModelSim GUI, right?
By the way did you ever simulate a SystemVerilog code containing a "final block" with ModelSim? if not could you please try it and tell me the results? thanks- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Model Technology ModelSim SE qverilog 10.1e Compiler 2013.06 Jun 11 2013
/u/prod/release/10.1e/modeltech/linux/qverilog final1.sv
-- Compiling module test
Top level modules:
test
+ /u/release/10.1e/modeltech/linux/vsim -lib work test -c -do run -all; quit -f -appendlog -l qverilog.log -vopt
# vsim -appendlog -do {run -all; quit -f} -l qverilog.log -lib work -c -vopt test
# ** Note: (vsim-3812) Design is being optimized...
# // ModelSim SE 10.1e Jun 11 2013 Linux 3.0.13-0.27-default
# //
# // Copyright 1991-2013 Mentor Graphics Corporation
# // All Rights Reserved.
# //
# // THIS WORK CONTAINS TRADE SECRET AND PROPRIETARY INFORMATION
# // WHICH IS THE PROPERTY OF MENTOR GRAPHICS CORPORATION OR ITS
# // LICENSORS AND IS SUBJECT TO LICENSE TERMS.
# //
# Loading sv_std.std
# Loading work.test(fast)
# run -all
# Simulation has been started
# ** Note: $finish : final1.sv(4)
# Time: 2 ns Iteration: 0 Instance: /test
# This should be shown at the end
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank You Dave!
I guess instead of using the GUI, you typed the tcl script and this time the output looks fine.- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page