1 |
9 |
jefflieu |
# Copyright (C) 1991-2008 Altera Corporation
|
2 |
|
|
# Any megafunction design, and related netlist (encrypted or decrypted),
|
3 |
|
|
# support information, device programming or simulation file, and any other
|
4 |
|
|
# associated documentation or information provided by Altera or a partner
|
5 |
|
|
# under Altera's Megafunction Partnership Program may be used only
|
6 |
|
|
# to program PLD devices (but not masked PLD devices) from Altera. Any
|
7 |
|
|
# other use of such megafunction design, netlist, support information,
|
8 |
|
|
# device programming or simulation file, or any other related documentation
|
9 |
|
|
# or information is prohibited for any other purpose, including, but not
|
10 |
|
|
# limited to modification, reverse engineering, de-compiling, or use with
|
11 |
|
|
# any other silicon devices, unless such use is explicitly licensed under
|
12 |
|
|
# a separate agreement with Altera or a megafunction partner. Title to the
|
13 |
|
|
# intellectual property, including patents, copyrights, trademarks, trade
|
14 |
|
|
# secrets, or maskworks, embodied in any such megafunction design, netlist,
|
15 |
|
|
# support information, device programming or simulation file, or any other
|
16 |
|
|
# related documentation or information provided by Altera or a megafunction
|
17 |
|
|
# partner, remains with Altera, the megafunction partner, or their respective
|
18 |
|
|
# licensors. No other licenses, including any licenses needed under any third
|
19 |
|
|
# party's intellectual property, are provided herein.
|
20 |
|
|
|
21 |
|
|
global env ;
|
22 |
|
|
if [regexp {ModelSim ALTERA} [vsim -version]] {
|
23 |
|
|
;# Using OEM Version's ModelSIM .ini file (modelsim.ini at ModelSIM Altera installation directory)
|
24 |
|
|
} else {
|
25 |
|
|
# Using non-OEM Version, compile all of the libraries
|
26 |
|
|
vlib lpm_ver
|
27 |
|
|
vmap lpm_ver lpm_ver
|
28 |
|
|
vlog -work lpm_ver $env(QUARTUS_ROOTDIR)/eda/sim_lib/220model.v
|
29 |
|
|
|
30 |
|
|
vlib altera_mf_ver
|
31 |
|
|
vmap altera_mf_ver altera_mf_ver
|
32 |
|
|
vlog -work altera_mf_ver $env(QUARTUS_ROOTDIR)/eda/sim_lib/altera_mf.v
|
33 |
|
|
|
34 |
|
|
vlib sgate_ver
|
35 |
|
|
vmap sgate_ver sgate_ver
|
36 |
|
|
vlog -work sgate_ver $env(QUARTUS_ROOTDIR)/eda/sim_lib/sgate.v
|
37 |
|
|
|
38 |
|
|
vlib cycloneiv_hssi_ver
|
39 |
|
|
vmap cycloneiv_hssi_ver cycloneiv_hssi_ver
|
40 |
|
|
vlog -work cycloneiv_hssi_ver $env(QUARTUS_ROOTDIR)/eda/sim_lib/cycloneiv_hssi_atoms.v
|
41 |
|
|
|
42 |
|
|
}
|
43 |
|
|
|
44 |
|
|
# Create the work library
|
45 |
|
|
vlib work
|
46 |
|
|
|
47 |
|
|
# Now compile the Verilog files one by one
|
48 |
|
|
|
49 |
|
|
vlog -work work ../../sgmii.vo
|
50 |
|
|
vlog -work work ../model/*.v
|
51 |
|
|
vlog -work work *.v
|
52 |
|
|
|
53 |
|
|
# Now run the simulation
|
54 |
|
|
vsim \
|
55 |
|
|
-novopt\
|
56 |
|
|
+transport_int_delays \
|
57 |
|
|
+transport_path_delays \
|
58 |
|
|
+notimingchecks \
|
59 |
|
|
-L altera_mf_ver -L lpm_ver -L sgate_ver -L cycloneiv_hssi_ver\
|
60 |
|
|
-t ps \
|
61 |
|
|
-noglitch \
|
62 |
|
|
-multisource_delay latest \
|
63 |
|
|
tb
|
64 |
|
|
set NumericStdNoWarnings 1
|
65 |
|
|
set StdArithNoWarnings 1
|
66 |
|
|
onbreak { resume }
|
67 |
|
|
do sgmii_wave.do
|
68 |
|
|
run -all
|
69 |
|
|
|