<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://strudel.pld.ttu.ee/wiki/e/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hartz</id>
		<title>ATI public wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://strudel.pld.ttu.ee/wiki/e/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hartz"/>
		<link rel="alternate" type="text/html" href="https://strudel.pld.ttu.ee/wiki/e/index.php/Special:Contributions/Hartz"/>
		<updated>2026-05-20T10:32:23Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.26.4</generator>

	<entry>
		<id>https://strudel.pld.ttu.ee/wiki/e/index.php?title=File:ModelSim_simulation_run_gui.png&amp;diff=3158</id>
		<title>File:ModelSim simulation run gui.png</title>
		<link rel="alternate" type="text/html" href="https://strudel.pld.ttu.ee/wiki/e/index.php?title=File:ModelSim_simulation_run_gui.png&amp;diff=3158"/>
				<updated>2025-02-20T09:34:09Z</updated>
		
		<summary type="html">&lt;p&gt;Hartz: Hartz uploaded a new version of File:ModelSim simulation run gui.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hartz</name></author>	</entry>

	<entry>
		<id>https://strudel.pld.ttu.ee/wiki/e/index.php?title=File:ModelSim_simulation_run_gui.png&amp;diff=3157</id>
		<title>File:ModelSim simulation run gui.png</title>
		<link rel="alternate" type="text/html" href="https://strudel.pld.ttu.ee/wiki/e/index.php?title=File:ModelSim_simulation_run_gui.png&amp;diff=3157"/>
				<updated>2025-02-20T09:32:25Z</updated>
		
		<summary type="html">&lt;p&gt;Hartz: Hartz uploaded a new version of File:ModelSim simulation run gui.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hartz</name></author>	</entry>

	<entry>
		<id>https://strudel.pld.ttu.ee/wiki/e/index.php?title=ModelSim_ENG&amp;diff=3156</id>
		<title>ModelSim ENG</title>
		<link rel="alternate" type="text/html" href="https://strudel.pld.ttu.ee/wiki/e/index.php?title=ModelSim_ENG&amp;diff=3156"/>
				<updated>2025-02-20T09:31:37Z</updated>
		
		<summary type="html">&lt;p&gt;Hartz: Simu explanation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Before we start==&lt;br /&gt;
&lt;br /&gt;
Go to your project directory in the linux command line by using command '''cd'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/P/lab_1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your target directory does not exist, you can create it with command '''mkdir'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p /P/lab_1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;&lt;br /&gt;
IT IS HIGHLY SUGGESTED to develop your code in the '''~/Desktop''' directory.&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After you completed your work '''move''' (mv) or '''copy''' (cp) your work to the '''~/P''' folder.&lt;br /&gt;
&lt;br /&gt;
==Linux environment setup==&lt;br /&gt;
&lt;br /&gt;
In the lab class, we need to set up the Linux command line environment, which allows&lt;br /&gt;
us to use ModelSim. &lt;br /&gt;
&lt;br /&gt;
The command for the environment choices is cad. The command must&lt;br /&gt;
be entered twice.&lt;br /&gt;
&lt;br /&gt;
To select ModelSim, choose option 2 (Mentor Graphics 2021 EDA version).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;&lt;br /&gt;
Another important note to remember is that ModelSim&lt;br /&gt;
doesn’t support CTRL+c shortcut.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Starting ModelSim==&lt;br /&gt;
To start the program, you must insert the command&lt;br /&gt;
&lt;br /&gt;
'''vsim &amp;amp;'''&lt;br /&gt;
&lt;br /&gt;
The '''&amp;amp;''' in the end of the command shows that the program is run in the background and the&amp;lt;br&amp;gt;&lt;br /&gt;
prompt is returned immediately. It means that to run another process, you don’t have&amp;lt;br&amp;gt;&lt;br /&gt;
to open a new command line window. You can use '''&amp;amp;''' behind every process command.&lt;br /&gt;
&lt;br /&gt;
[[File:Modelsim_start.png|588px|ModelSim main view]]&amp;lt;br&amp;gt;&lt;br /&gt;
Figure 1. ModelSim main view.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;&lt;br /&gt;
If you forgot&amp;lt;/span&amp;gt; to change your working directory before, it is also possible to do it now.&lt;br /&gt;
&lt;br /&gt;
File-&amp;gt;Change Directory&amp;lt;br&amp;gt;&lt;br /&gt;
Navigate to the directory containing your design files&amp;lt;br&amp;gt;&lt;br /&gt;
Ok&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Compiling the design==&lt;br /&gt;
To compile your design you can either create a new project and compile the files&amp;lt;br&amp;gt;&lt;br /&gt;
in the project or just compile every file without creating a project. Somewhat&amp;lt;br&amp;gt;&lt;br /&gt;
easier is to create a new project. This gives you the chance to open the project&amp;lt;br&amp;gt;&lt;br /&gt;
later without any need to specify the files in there or the library used.&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;Option1: Compilation without project creation - preferred&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Creating a compilation library====&lt;br /&gt;
A compilation library is a directory on your disk into which all HDL designs are compiled.&amp;lt;br&amp;gt;&lt;br /&gt;
You can specify this library through the ModelSim or it can be created using operation system&amp;lt;br&amp;gt;&lt;br /&gt;
commands. Usual library name is work. Now lets create a directory called work&amp;lt;br&amp;gt;&lt;br /&gt;
and map the directory to the logical library named work.&lt;br /&gt;
&lt;br /&gt;
* File-&amp;gt;New-&amp;gt;Library&lt;br /&gt;
* Select Create a new library and a logical mapping to it (Figure 2).&lt;br /&gt;
* Type work into the library form. Note that it’s duplicated.&lt;br /&gt;
* Select Ok.&lt;br /&gt;
* Verify that the directory with the name work has been created in your lab directory.&lt;br /&gt;
&lt;br /&gt;
[[File:ModelSim_new_work.png|400px|ModelSim new work library]]&amp;lt;br&amp;gt;&lt;br /&gt;
Figure 2. Creating new work library&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Compiling your design====&lt;br /&gt;
Now lets compile the design.&amp;lt;br&amp;gt;&lt;br /&gt;
For example we’ll take the lab1 mux.vhd VHDL file.&lt;br /&gt;
&lt;br /&gt;
* Compile-&amp;gt;Compile…&lt;br /&gt;
* The following dialog box appears (Figure 3).&lt;br /&gt;
* Make sure that Library is set to work.&lt;br /&gt;
* Select the design file you want to compile, for example mux.vhd and then click Compile.&lt;br /&gt;
* Check the main ModelSim window for the results of compilation.&lt;br /&gt;
&lt;br /&gt;
[[File:ModelSim_compile.png|400px|ModelSim new work library]]&amp;lt;br&amp;gt;&lt;br /&gt;
Figure 3. Compiling source files&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;Option2: Compiling with project creation - WIP&amp;lt;/span&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
==Simulation==&lt;br /&gt;
===Starting the simulator===&lt;br /&gt;
To invoke the simulator:&lt;br /&gt;
&lt;br /&gt;
# Simulate&lt;br /&gt;
# Start Simulation&lt;br /&gt;
# In the design tab find work library.&lt;br /&gt;
## In the work library find the topmost design’s testbench you wish to simulate.&lt;br /&gt;
## Be aware to uncheck the Enable optimization box.&lt;br /&gt;
# Optimization Options&lt;br /&gt;
# &amp;quot;Apply full visibility to all modules (full debug mode)&amp;quot;&lt;br /&gt;
## Selecting this will keep all debug signals in your design&lt;br /&gt;
# Ok.&lt;br /&gt;
&lt;br /&gt;
[[File:ModelSim_simlation.png|800px|ModelSim Simulation]]&amp;lt;br&amp;gt;&lt;br /&gt;
Figure 4. Starting simulation for the design TestBench&lt;br /&gt;
&lt;br /&gt;
The “'''loading…'''” message will appear in the main window to &amp;lt;br&amp;gt;&lt;br /&gt;
confirm that the files have loaded correctly. &amp;lt;br&amp;gt;&lt;br /&gt;
If you receive an error message asking to re-compile the testbench design, &amp;lt;br&amp;gt;&lt;br /&gt;
then you have compiled the files in the wrong order.&lt;br /&gt;
&lt;br /&gt;
====Organizing the display====&lt;br /&gt;
Usually, windows Workspace, Objects, and Wave are used during simulation (Figure 5).&amp;lt;br&amp;gt;&lt;br /&gt;
These should open automatically, OR you can open them from the '''View''' menu.&lt;br /&gt;
&lt;br /&gt;
====Adding Signals to Wave window====&lt;br /&gt;
&lt;br /&gt;
# Highlight the '''Objects''' window by clicking it.&lt;br /&gt;
# Right-click on the '''Objects''' window&lt;br /&gt;
# '''Add to''' -&amp;gt; '''Wave''' -&amp;gt; '''Signals in Design'''&lt;br /&gt;
&lt;br /&gt;
[[File:ModelSim_signal_wave.png|800px|ModelSim Simulation]]&amp;lt;br&amp;gt;&lt;br /&gt;
Figure 5. Adding design signals to the '''Wave''' window&lt;br /&gt;
&lt;br /&gt;
===Running Simulation===&lt;br /&gt;
&lt;br /&gt;
====Using run command====&lt;br /&gt;
You can run the simulation for a set amount of time by typing run X in the command&amp;lt;br&amp;gt;&lt;br /&gt;
line of the Main window, where X is the number of nanoseconds that you wish to run for.&amp;lt;br&amp;gt;&lt;br /&gt;
For example, run for 100 ns: VSIM &amp;gt; '''run 100 ns'''&lt;br /&gt;
&lt;br /&gt;
Command run without specifying the time will execute the simulation for the&amp;lt;br&amp;gt;&lt;br /&gt;
default amount of time. You can set the default run period:&lt;br /&gt;
&lt;br /&gt;
* Simulate-&amp;gt;Runtime Options…&lt;br /&gt;
* Enter the amount of time into the Default Run box.&lt;br /&gt;
* Select Ok.&lt;br /&gt;
* Simulate-&amp;gt;Run-&amp;gt;Run “default time” ns.&lt;br /&gt;
&lt;br /&gt;
====Using GUI====&lt;br /&gt;
Find icons shown in Figure 6 in the '''Main''' window.&amp;lt;br&amp;gt;&lt;br /&gt;
You will need to use Icons (explained in bold) most commonly.&lt;br /&gt;
&lt;br /&gt;
[[File:ModelSim_simulation_run_gui.png|300px|ModelSim Simulation Buttons]]&amp;lt;br&amp;gt;&lt;br /&gt;
Figure 6. ModelSim Simulation Buttons&lt;br /&gt;
&lt;br /&gt;
# '''Restart''': Restarts the simulation&lt;br /&gt;
# '''100ns''' (default): custom time for simulation length&lt;br /&gt;
# '''Run''': Simulates for custom specified time&lt;br /&gt;
# Continue Run&lt;br /&gt;
# '''Run All''': Runs simulation endlessly OR until &amp;quot;wait&amp;quot; statement is reached in the testbench&lt;br /&gt;
# Break: Pauses the simulation&lt;br /&gt;
# Stop: Stops Simulation without the possibility of continuing.&lt;/div&gt;</summary>
		<author><name>Hartz</name></author>	</entry>

	<entry>
		<id>https://strudel.pld.ttu.ee/wiki/e/index.php?title=File:ModelSim_simulation_run_gui.png&amp;diff=3155</id>
		<title>File:ModelSim simulation run gui.png</title>
		<link rel="alternate" type="text/html" href="https://strudel.pld.ttu.ee/wiki/e/index.php?title=File:ModelSim_simulation_run_gui.png&amp;diff=3155"/>
				<updated>2025-02-20T09:31:04Z</updated>
		
		<summary type="html">&lt;p&gt;Hartz: Hartz uploaded a new version of File:ModelSim simulation run gui.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hartz</name></author>	</entry>

	<entry>
		<id>https://strudel.pld.ttu.ee/wiki/e/index.php?title=File:ModelSim_simulation_run_gui.png&amp;diff=3154</id>
		<title>File:ModelSim simulation run gui.png</title>
		<link rel="alternate" type="text/html" href="https://strudel.pld.ttu.ee/wiki/e/index.php?title=File:ModelSim_simulation_run_gui.png&amp;diff=3154"/>
				<updated>2025-02-20T09:06:19Z</updated>
		
		<summary type="html">&lt;p&gt;Hartz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hartz</name></author>	</entry>

	<entry>
		<id>https://strudel.pld.ttu.ee/wiki/e/index.php?title=File:ModelSim_signal_wave.png&amp;diff=3153</id>
		<title>File:ModelSim signal wave.png</title>
		<link rel="alternate" type="text/html" href="https://strudel.pld.ttu.ee/wiki/e/index.php?title=File:ModelSim_signal_wave.png&amp;diff=3153"/>
				<updated>2025-02-20T08:59:38Z</updated>
		
		<summary type="html">&lt;p&gt;Hartz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hartz</name></author>	</entry>

	<entry>
		<id>https://strudel.pld.ttu.ee/wiki/e/index.php?title=File:ModelSim_simlation.png&amp;diff=3152</id>
		<title>File:ModelSim simlation.png</title>
		<link rel="alternate" type="text/html" href="https://strudel.pld.ttu.ee/wiki/e/index.php?title=File:ModelSim_simlation.png&amp;diff=3152"/>
				<updated>2025-02-20T08:37:25Z</updated>
		
		<summary type="html">&lt;p&gt;Hartz: Hartz uploaded a new version of File:ModelSim simlation.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hartz</name></author>	</entry>

	<entry>
		<id>https://strudel.pld.ttu.ee/wiki/e/index.php?title=File:ModelSim_simlation.png&amp;diff=3151</id>
		<title>File:ModelSim simlation.png</title>
		<link rel="alternate" type="text/html" href="https://strudel.pld.ttu.ee/wiki/e/index.php?title=File:ModelSim_simlation.png&amp;diff=3151"/>
				<updated>2025-02-20T08:33:27Z</updated>
		
		<summary type="html">&lt;p&gt;Hartz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hartz</name></author>	</entry>

	<entry>
		<id>https://strudel.pld.ttu.ee/wiki/e/index.php?title=ModelSim_ENG&amp;diff=3150</id>
		<title>ModelSim ENG</title>
		<link rel="alternate" type="text/html" href="https://strudel.pld.ttu.ee/wiki/e/index.php?title=ModelSim_ENG&amp;diff=3150"/>
				<updated>2025-02-19T15:01:21Z</updated>
		
		<summary type="html">&lt;p&gt;Hartz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Before we start==&lt;br /&gt;
&lt;br /&gt;
Go to your project directory in the linux command line by using command '''cd'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/P/lab_1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your target directory does not exist, you can create it with command '''mkdir'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p /P/lab_1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;&lt;br /&gt;
IT IS HIGHLY SUGGESTED to develop your code in the '''~/Desktop''' directory.&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After you completed your work '''move''' (mv) or '''copy''' (cp) your work to the '''~/P''' folder.&lt;br /&gt;
&lt;br /&gt;
==Linux environment setup==&lt;br /&gt;
&lt;br /&gt;
In the lab class, we need to set up the Linux command line environment, which allows&lt;br /&gt;
us to use ModelSim. &lt;br /&gt;
&lt;br /&gt;
The command for the environment choices is cad. The command must&lt;br /&gt;
be entered twice.&lt;br /&gt;
&lt;br /&gt;
To select ModelSim, choose option 2 (Mentor Graphics 2021 EDA version).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;&lt;br /&gt;
Another important note to remember is that ModelSim&lt;br /&gt;
doesn’t support CTRL+c shortcut.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Starting ModelSim==&lt;br /&gt;
To start the program, you must insert the command&lt;br /&gt;
&lt;br /&gt;
'''vsim &amp;amp;'''&lt;br /&gt;
&lt;br /&gt;
The '''&amp;amp;''' in the end of the command shows that the program is run in the background and the&amp;lt;br&amp;gt;&lt;br /&gt;
prompt is returned immediately. It means that to run another process, you don’t have&amp;lt;br&amp;gt;&lt;br /&gt;
to open a new command line window. You can use '''&amp;amp;''' behind every process command.&lt;br /&gt;
&lt;br /&gt;
[[File:Modelsim_start.png|588px|ModelSim main view]]&amp;lt;br&amp;gt;&lt;br /&gt;
Figure 1. ModelSim main view.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;&lt;br /&gt;
If you forgot&amp;lt;/span&amp;gt; to change your working directory before, it is also possible to do it now.&lt;br /&gt;
&lt;br /&gt;
File-&amp;gt;Change Directory&amp;lt;br&amp;gt;&lt;br /&gt;
Navigate to the directory containing your design files&amp;lt;br&amp;gt;&lt;br /&gt;
Ok&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Compiling the design==&lt;br /&gt;
To compile your design you can either create a new project and compile the files&amp;lt;br&amp;gt;&lt;br /&gt;
in the project or just compile every file without creating a project. Somewhat&amp;lt;br&amp;gt;&lt;br /&gt;
easier is to create a new project. This gives you the chance to open the project&amp;lt;br&amp;gt;&lt;br /&gt;
later without any need to specify the files in there or the library used.&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;Option1: Compilation without project creation - preferred&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Creating a compilation library====&lt;br /&gt;
A compilation library is a directory on your disk into which all HDL designs are compiled.&amp;lt;br&amp;gt;&lt;br /&gt;
You can specify this library through the ModelSim or it can be created using operation system&amp;lt;br&amp;gt;&lt;br /&gt;
commands. Usual library name is work. Now lets create a directory called work&amp;lt;br&amp;gt;&lt;br /&gt;
and map the directory to the logical library named work.&lt;br /&gt;
&lt;br /&gt;
* File-&amp;gt;New-&amp;gt;Library&lt;br /&gt;
* Select Create a new library and a logical mapping to it (Figure 2).&lt;br /&gt;
* Type work into the library form. Note that it’s duplicated.&lt;br /&gt;
* Select Ok.&lt;br /&gt;
* Verify that the directory with the name work has been created in your lab directory.&lt;br /&gt;
&lt;br /&gt;
[[File:ModelSim_new_work.png|400px|ModelSim new work library]]&amp;lt;br&amp;gt;&lt;br /&gt;
Figure 2. Creating new work library&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Compiling your design====&lt;br /&gt;
Now lets compile the design.&amp;lt;br&amp;gt;&lt;br /&gt;
For example we’ll take the lab1 mux.vhd VHDL file.&lt;br /&gt;
&lt;br /&gt;
* Compile-&amp;gt;Compile…&lt;br /&gt;
* The following dialog box appears (Figure 3).&lt;br /&gt;
* Make sure that Library is set to work.&lt;br /&gt;
* Select the design file you want to compile, for example mux.vhd and then click Compile.&lt;br /&gt;
* Check the main ModelSim window for the results of compilation.&lt;br /&gt;
&lt;br /&gt;
[[File:ModelSim_compile.png|400px|ModelSim new work library]]&amp;lt;br&amp;gt;&lt;br /&gt;
Figure 3. Compiling source files&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;Option2: Compiling with project creation - WIP&amp;lt;/span&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
==Simulation==&lt;br /&gt;
===Starting the simulator===&lt;br /&gt;
To invoke the simulator:&lt;br /&gt;
&lt;br /&gt;
* Simulator-&amp;gt;Start Simulation&lt;br /&gt;
* In the design tab find work library.&lt;br /&gt;
* In the work library find the topmost design’s testbench you wish to simulate.&lt;br /&gt;
* Be aware to uncheck the Enable optimization box.&lt;br /&gt;
* Select it and click Ok.&lt;br /&gt;
&lt;br /&gt;
Another way is according to Figure x.&lt;/div&gt;</summary>
		<author><name>Hartz</name></author>	</entry>

	<entry>
		<id>https://strudel.pld.ttu.ee/wiki/e/index.php?title=ModelSim_ENG&amp;diff=3149</id>
		<title>ModelSim ENG</title>
		<link rel="alternate" type="text/html" href="https://strudel.pld.ttu.ee/wiki/e/index.php?title=ModelSim_ENG&amp;diff=3149"/>
				<updated>2025-02-19T15:00:17Z</updated>
		
		<summary type="html">&lt;p&gt;Hartz: Design compilation - Option 1 done&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Before we start==&lt;br /&gt;
&lt;br /&gt;
Go to your project directory in the linux command line by using command '''cd'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/P/lab_1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your target directory does not exist, you can create it with command '''mkdir'''&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p /P/lab_1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;&lt;br /&gt;
IT IS HIGHLY SUGGESTED to develop your code in the '''~/Desktop''' directory.&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After you completed your work '''move''' (mv) or '''copy''' (cp) your work to the '''~/P''' folder.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the lab class, we need to set up the Linux command line environment, which allows&lt;br /&gt;
us to use ModelSim. &lt;br /&gt;
&lt;br /&gt;
The command for the environment choices is cad. The command must&lt;br /&gt;
be entered twice.&lt;br /&gt;
&lt;br /&gt;
To select ModelSim, choose option 2 (Mentor Graphics 2021 EDA version).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;&lt;br /&gt;
Another important note to remember is that ModelSim&lt;br /&gt;
doesn’t support CTRL+c shortcut.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Starting ModelSim==&lt;br /&gt;
To start the program, you must insert the command&lt;br /&gt;
&lt;br /&gt;
'''vsim &amp;amp;'''&lt;br /&gt;
&lt;br /&gt;
The '''&amp;amp;''' in the end of the command shows that the program is run in the background and the&amp;lt;br&amp;gt;&lt;br /&gt;
prompt is returned immediately. It means that to run another process, you don’t have&amp;lt;br&amp;gt;&lt;br /&gt;
to open a new command line window. You can use '''&amp;amp;''' behind every process command.&lt;br /&gt;
&lt;br /&gt;
[[File:Modelsim_start.png|588px|ModelSim main view]]&amp;lt;br&amp;gt;&lt;br /&gt;
Figure 1. ModelSim main view.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;&lt;br /&gt;
If you forgot&amp;lt;/span&amp;gt; to change your working directory before, it is also possible to do it now.&lt;br /&gt;
&lt;br /&gt;
File-&amp;gt;Change Directory&amp;lt;br&amp;gt;&lt;br /&gt;
Navigate to the directory containing your design files&amp;lt;br&amp;gt;&lt;br /&gt;
Ok&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Compiling the design==&lt;br /&gt;
To compile your design you can either create a new project and compile the files&amp;lt;br&amp;gt;&lt;br /&gt;
in the project or just compile every file without creating a project. Somewhat&amp;lt;br&amp;gt;&lt;br /&gt;
easier is to create a new project. This gives you the chance to open the project&amp;lt;br&amp;gt;&lt;br /&gt;
later without any need to specify the files in there or the library used.&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;Option1: Compilation without project creation - preferred&amp;lt;/span&amp;gt;===&lt;br /&gt;
====Creating a compilation library====&lt;br /&gt;
A compilation library is a directory on your disk into which all HDL designs are compiled.&amp;lt;br&amp;gt;&lt;br /&gt;
You can specify this library through the ModelSim or it can be created using operation system&amp;lt;br&amp;gt;&lt;br /&gt;
commands. Usual library name is work. Now lets create a directory called work&amp;lt;br&amp;gt;&lt;br /&gt;
and map the directory to the logical library named work.&lt;br /&gt;
&lt;br /&gt;
* File-&amp;gt;New-&amp;gt;Library&lt;br /&gt;
* Select Create a new library and a logical mapping to it (Figure 2).&lt;br /&gt;
* Type work into the library form. Note that it’s duplicated.&lt;br /&gt;
* Select Ok.&lt;br /&gt;
* Verify that the directory with the name work has been created in your lab directory.&lt;br /&gt;
&lt;br /&gt;
[[File:ModelSim_new_work.png|400px|ModelSim new work library]]&amp;lt;br&amp;gt;&lt;br /&gt;
Figure 2. Creating new work library&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Compiling your design====&lt;br /&gt;
Now lets compile the design.&amp;lt;br&amp;gt;&lt;br /&gt;
For example we’ll take the lab1 mux.vhd VHDL file.&lt;br /&gt;
&lt;br /&gt;
* Compile-&amp;gt;Compile…&lt;br /&gt;
* The following dialog box appears (Figure 3).&lt;br /&gt;
* Make sure that Library is set to work.&lt;br /&gt;
* Select the design file you want to compile, for example mux.vhd and then click Compile.&lt;br /&gt;
* Check the main ModelSim window for the results of compilation.&lt;br /&gt;
&lt;br /&gt;
[[File:ModelSim_compile.png|400px|ModelSim new work library]]&amp;lt;br&amp;gt;&lt;br /&gt;
Figure 3. Compiling source files&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;Option2: Compiling with project creation - WIP&amp;lt;/span&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
==Simulation==&lt;br /&gt;
===Starting the simulator===&lt;br /&gt;
To invoke the simulator:&lt;br /&gt;
&lt;br /&gt;
* Simulator-&amp;gt;Start Simulation&lt;br /&gt;
* In the design tab find work library.&lt;br /&gt;
* In the work library find the topmost design’s testbench you wish to simulate.&lt;br /&gt;
* Be aware to uncheck the Enable optimization box.&lt;br /&gt;
* Select it and click Ok.&lt;br /&gt;
&lt;br /&gt;
Another way is according to Figure x.&lt;/div&gt;</summary>
		<author><name>Hartz</name></author>	</entry>

	<entry>
		<id>https://strudel.pld.ttu.ee/wiki/e/index.php?title=File:ModelSim_compile.png&amp;diff=3148</id>
		<title>File:ModelSim compile.png</title>
		<link rel="alternate" type="text/html" href="https://strudel.pld.ttu.ee/wiki/e/index.php?title=File:ModelSim_compile.png&amp;diff=3148"/>
				<updated>2025-02-19T14:55:14Z</updated>
		
		<summary type="html">&lt;p&gt;Hartz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hartz</name></author>	</entry>

	<entry>
		<id>https://strudel.pld.ttu.ee/wiki/e/index.php?title=File:ModelSim_new_work.png&amp;diff=3147</id>
		<title>File:ModelSim new work.png</title>
		<link rel="alternate" type="text/html" href="https://strudel.pld.ttu.ee/wiki/e/index.php?title=File:ModelSim_new_work.png&amp;diff=3147"/>
				<updated>2025-02-19T14:50:53Z</updated>
		
		<summary type="html">&lt;p&gt;Hartz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hartz</name></author>	</entry>

	<entry>
		<id>https://strudel.pld.ttu.ee/wiki/e/index.php?title=File:Modelsim_start.png&amp;diff=3146</id>
		<title>File:Modelsim start.png</title>
		<link rel="alternate" type="text/html" href="https://strudel.pld.ttu.ee/wiki/e/index.php?title=File:Modelsim_start.png&amp;diff=3146"/>
				<updated>2025-02-19T14:46:26Z</updated>
		
		<summary type="html">&lt;p&gt;Hartz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hartz</name></author>	</entry>

	<entry>
		<id>https://strudel.pld.ttu.ee/wiki/e/index.php?title=ModelSim_ENG&amp;diff=3145</id>
		<title>ModelSim ENG</title>
		<link rel="alternate" type="text/html" href="https://strudel.pld.ttu.ee/wiki/e/index.php?title=ModelSim_ENG&amp;diff=3145"/>
				<updated>2025-02-19T14:17:00Z</updated>
		
		<summary type="html">&lt;p&gt;Hartz: Inglise keelne juhend ModelSim&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Before we start==&lt;br /&gt;
In the lab class, we need to set up the Linux command line environment, which allows&lt;br /&gt;
us to use ModelSim. &lt;br /&gt;
&lt;br /&gt;
The command for the environment choices is cad. The command must&lt;br /&gt;
be entered twice.&lt;br /&gt;
&lt;br /&gt;
To select ModelSim, choose option 2 (Mentor Graphics 2021 EDA version).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;&lt;br /&gt;
Another important note to remember is that ModelSim&lt;br /&gt;
doesn’t support CTRL+c shortcut.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Starting ModelSim==&lt;br /&gt;
To start the program you must insert command&lt;br /&gt;
&lt;br /&gt;
'''vsim &amp;amp;'''&lt;br /&gt;
&lt;br /&gt;
The &amp;amp; in the end of the command shows that the program is run in the backround and the&amp;lt;br&amp;gt;&lt;br /&gt;
promt is returned immediately. It means that to run another process you don’t have&amp;lt;br&amp;gt;&lt;br /&gt;
to open a new command line window. You can use '''&amp;amp;''' behind every process command.&lt;/div&gt;</summary>
		<author><name>Hartz</name></author>	</entry>

	</feed>