« Prev | Next » File Management with Relative Paths in Active-HDL File structure in Active-HDL Every time you open a new design project, Active-HDL will automatically generate a design directory for you. It has the same name as your project name. Each design directory starts with three subdirectories: SRC, COMPILE, and LOG. The SRC subdirectory contains source files such as VHDL/Verilog source files, block diagram files, and state diagram source files. The COMPILE subdirectory contains the files that record compilation information for your design and HDL files generated from Block Diagram and State Diagram files. All log files such as log for your console are stored in the LOG subdirectory. Also, you can include files that you have stored elsewhere in your computer in your design project. You have two options for those files: either make local copies to your design directory, or just put a link to where you have physically stored those files. Figure 1 shows how you can specify if you want a local copy: Figure 1: Make local copy checkbox in Add Files window When local copy of the file was created, it was placed in the SRC subfolder of your current project folder. You can always refer to this subfolder using the $dsn system variable: $dsn\src\ All your design files, no matter if it has a local copy or not, are shown in the Design Browser window. The hierarchy structure shown in the Design Browser is based on your design, not on how the files are physically stored on your computer. Relative Paths for Linked File If a design file does not have a local copy, it is a linked file. Linked files are shown in Design Browser window with a special Link icon (Figure 2): Figure 2: Linked file icon in the Design Browser. In an interactive way, you can compile linked files from the Design Browser window by right-clicking on the file and choosing the compile option. To compile linked files into your Active-HDL design using script command, you have following ways: Compile the file with its own absolute path: Example: acom C:\My_Designs\FIFO_8BIT\FIFO_CORE\src\fifo.vhd Compile file by using link: Example: acom top.vhd Note: The path to link the file ($dsn\src\..) must be omitted. The compiler will search for path from design data. Also, avoid identical file names within same design. Using macro file: Prepare macro file called macro.do with sequence of commands listed below: opendesign \my_design.adf --Note: You may use variables like $designs. quiet on set path echo $path addfile $path\ quiet off --Now you can execute the do file by: Avhdl.exe ?do \macro.do --This way your link will be automatically updated. Additional Information Setting Environmental Variables You can set and then use environment variables to facilitate you specification of paths. To set an environment variable, use set command in the console window. You can set multiple variables. set path C:\My_Designs\FIFO_8BIT\FIFO_CORE\src set # aldec="C:\Aldec\Active-HDL 8.3" # ...... # path="C:\My_Designs\FIFO_8BIT\FIFO_CORE\src" # ..... This way, you can easily handle linked files from multiple sources. For example, you can add files to your design using above defined variables by: addfile -vhdl $path\fifo.vhd # Adding file C:\My_Designs\FIFO_8BIT\FIFO_CORE\src\fifo.vhd ... Done addfile -vhdl $path\fifo_tb.vhd # Adding file C:\My_Designs\FIFO_8BIT\FIFO_CORE\src\fifo_tb.vhd ... Done Figure 3: Design Browser display of Added Linked Files. Previous article Next article