|
A Tutorial using vmake and makeby Emmett Bearden emmett_bearden@yahoo.com http://www.oocities.org/emmett_bearden/vhdl
tutorial vmake is This is a tutorial of how to use make with VHDL source files and Model Technology's ModelSim simulator. This tutorial is suppose to make your life easier. Let's begin. Problem: You have a VHDL project with many source files. Many of the design units are dependent on one another. For instance, Here is our design structure.
![]() tb_one is our testbench entity and it has an architecture named test. The test architecture instantiates 3 components; cpu, pnet_read, and pnet_write. The entity cpu has one architecture named beh. The entity pnet_read has 2 architectures beh and rtl. The entity pnet_write has 2 architectures, beh and dummy. The rtl architecture of the pnet_read entity instantiates 2 components named read_frame and write_data. The entity read_frame has 2 architectures, gates and rtl. The entity write_data has 2 architectures, gates and rtl. The beh architecture of the cpu entity uses the package p. The gates and rtl architectures of the read_frame entity uses the package p. The gates and rtl architectures of the write_data entity uses the package p.
There is a better way! What this means is in order for you to simulate you must compile design units before they are referenced. This is generally true of any language. Well rather than committing this design structure to memory let a program called make keep track for you. make uses a special file called Makefile to tell it the dependencies between different files in a project. Lucky for you Model Technology makes a program called vmake that creates this Makefile for you. The only caveat is you must compile the structure once by hand...or do you? For simple designs that are compiled into the work library and all source files exist in one directory then Makefile.virgin should build your Makefile.work. Makefile.work is the desciption of your system as ModelSim understands it at this point in time. If you compile more design units then you will have to create a new Makefile.work.
A simple makefile consists of "rules" with the following syntax:
Makefile.virgin looks like
Now try and compile Makefile.virgin yourself %make -f Makefile.virgin
This will compile all .vhd files and build a Makefile.work for you. It could
fail for the following reasons:1. Syntax errors in your VHDL files 2. Makefile.work exists Now, link the file Makefile to Makefile.work
Are you getting the picture? Only those files that are dependent are made. I hope this has helped!
|
Download make_example.tar.gz.
|