Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HDL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
HDL
Commits
913beae8
Commit
913beae8
authored
10 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Made the script more generic by using command line arguments.
parent
c2bc38d7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/quartus/run_altera_simlib_comp
+35
-20
35 additions, 20 deletions
tools/quartus/run_altera_simlib_comp
with
35 additions
and
20 deletions
tools/quartus/run_altera_simlib_comp
+
35
−
20
View file @
913beae8
...
...
@@ -43,40 +43,55 @@
# 1) General tool and project settings
# - use '. <script>.sh' to have the settings apply in this shell, otherwise they get lost when <script>.sh returns
# Tool settings for selected target unb2
.
${
RADIOHDL
}
/tools/quartus/set_quartus unb2
.
${
RADIOHDL
}
/tools/modelsim/set_modelsim unb2
# Tool settings for selected target "", "unb1", or "unb2" (where "" defaults to target "unb1")
TARGET
=
${
1
:-}
if
[
"
${
TARGET
}
"
=
""
]
;
then
unb_error
$0
"Please specify all arguments
\n
Usage:
$0
<tool target> <compilation output directory> <FPGA device family>"
fi
# Select output directory for the library compilation results
OUTPUT_DIR
=
${
1
:-}
OUTPUT_DIR
=
${
2
:-}
if
[
"
${
OUTPUT_DIR
}
"
=
""
]
;
then
unb_error
$0
"Please specify an output directory"
unb_error
$0
"Please specify all arguments
\n
Usage:
$0
<tool target> <compilation output directory> <FPGA device family>"
fi
# Select FPGA device family for the library compilation
FAMILY
=
${
3
:-}
if
[
"
${
FAMILY
}
"
=
""
]
;
then
unb_error
$0
"Please specify all arguments
\n
Usage:
$0
<tool target> <compilation output directory> <FPGA device family>"
fi
echo
"Create Altera simulation libraries for Modelsim at output directory:
${
OUTPUT_DIR
}
"
# Define the FPGA families
FAMILIES
=
"arria10"
echo
""
echo
"Create Altera libraries for simulation with the following settings:"
echo
" - Tool target :
${
TARGET
}
"
echo
" - Output directory :
${
OUTPUT_DIR
}
"
echo
" - FPGA device family:
${
FAMILY
}
"
echo
""
# Tool settings for selected target
.
${
RADIOHDL
}
/tools/quartus/set_quartus
${
TARGET
}
.
${
RADIOHDL
}
/tools/modelsim/set_modelsim
${
TARGET
}
# 2) Create Modelsim .do file for compiling the Altera simulation libraries
# . verilog
quartus_sh
--simlib_comp
-family
${
FAMIL
IES
}
\
quartus_sh
--simlib_comp
-family
${
FAMIL
Y
}
\
-tool
modelsim
\
-tool_path
$VSIM_DIR
\
-language
verilog
\
-directory
${
OUTPUT_DIR
}
\
-log
altera_simlibs
_verilog.log
\
-cmd_file
altera_simlibs
_verilog.do
\
-log
${
FAMILY
}
_verilog.log
\
-cmd_file
${
FAMILY
}
_verilog.do
\
-gen_only
\
-suppress_messages
# . vhdl
quartus_sh
--simlib_comp
-family
${
FAMIL
IES
}
\
quartus_sh
--simlib_comp
-family
${
FAMIL
Y
}
\
-tool
modelsim
\
-tool_path
$VSIM_DIR
\
-language
vhdl
\
-directory
${
OUTPUT_DIR
}
\
-log
altera_simlibs
_vhdl.log
\
-cmd_file
altera_simlibs
_vhdl.do
\
-log
${
FAMILY
}
_vhdl.log
\
-cmd_file
${
FAMILY
}
_vhdl.do
\
-gen_only
\
-suppress_messages
...
...
@@ -84,8 +99,8 @@ quartus_sh --simlib_comp -family ${FAMILIES} \
cd
${
OUTPUT_DIR
}
# Keep the log files
mv
../
altera_simlibs
_verilog.log
.
mv
../
altera_simlibs
_vhdl.log
.
mv
../
${
FAMILY
}
_verilog.log
.
mv
../
${
FAMILY
}
_vhdl.log
.
# 3) Now use sed to replace 'vlib' by 'vlib -type directory'
...
...
@@ -103,9 +118,9 @@ mv ../altera_simlibs_vhdl.log .
#
# file.txt = the file name
sed
-i
's/vlib/vlib -type directory/g'
altera_simlibs
_verilog.do
sed
-i
's/vlib/vlib -type directory/g'
altera_simlibs
_vhdl.do
sed
-i
's/vlib/vlib -type directory/g'
${
FAMILY
}
_verilog.do
sed
-i
's/vlib/vlib -type directory/g'
${
FAMILY
}
_vhdl.do
# 4) Compile the Altera libraries with Modelsim
$VSIM_DIR
/vsim
-c
-do
altera_simlibs
_verilog.do
$VSIM_DIR
/vsim
-c
-do
altera_simlibs
_vhdl.do
$VSIM_DIR
/vsim
-c
-do
${
FAMILY
}
_verilog.do
$VSIM_DIR
/vsim
-c
-do
${
FAMILY
}
_vhdl.do
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment