6027 - Modelsim: How do I convert macro from AHDL to Modelsim since Crosslink IP simulation script is based on Aldec?
Please try the following notes for converting .do files from Aldec to Modelsim: Convert AHDL do file to Modelsim do file
1. Update the generated AHDL main *_run.do file and replace AHDL work library with Modelsim work library creation steps.
Example: Crosslink Pixel2Byte (p2b_sample)
$>: /sim/aldec/p2b_sample_run.do
Comment or delete:
#-- Simulation work library creation --
cd "C:/Users/lbeloso/Documents/TEMP/package/p2b_sample/pixel2byte_eval/p2b_sample/sim/aldec"
workspace create pixel2byte_space
design create p2b_sample_design
design open p2b_sample_design
Add the following:
##-- Modelsim work library creation
vlib work
vdel -lib work -all
vlib work
2. Update the generated AHDL sub *_rtl.do file.This is the file called under do command of the main *run.do file.
Example: Crosslink Pixel2Byte (p2b_sample)
$>: /sim/aldec/pixel2byte_rtl.do
2.1. For vlog command:
- Remove arguments: -v2k5 and *lifmd_black_boxes-aldec.vp
Example:
Original: vlog -v2k5 +define+PIXWIDTH=24 +define+DSI_TEST1 $diamond_dir/cae_library/simulation/blackbox/lifmd_black_boxes-aldec.vp $diamond_dir/cae_library/ ...
New: vlog +define+PIXWIDTH=24 +define+DSI_TEST1 $diamond_dir/cae_library/ ...
2.2. For vsim command:
- Replace "vsim +access +r " with "vsim -L work -L pmi_work -L ovi_lifmd "
Example: Original: vsim +access +r top
New: vsim -L work -L pmi_work -L ovi_lifmd top
2.3. For wave command:
- Replace "wave //${design_inst}_inst/*" with "view wave" and "add wave /*"
Example: Original: wave /top/${design_inst}_inst/*
New: view wave add wave /*
How to run in Modelsim
1. Open Modelsim
2. Run the updated *_run.do file Example: do /_run.do
Notes:
- Make sure that you are using Diamond version that supports Modelsim (i.e. Diamond 3.12)
- Make sure that "diamond_dir" variable in the *_run.do file points to the correct diamond version