Adding a Macro to the Liberator Toolset

 

Author:  Jonathan Hatcher

 

 

652-hatcher.ppt


/usr/cad/course/LiberatorAddedMacro.tar

This tutorial is an extension of the original homework 5 tutorial using the Liberator Toolset for optimization.    The toolset was originally developed for a handful of specified macros, and this tutorial outlines the steps for introducing a new macro to the toolset. 

 

 

File 1:

File name: MacroGen*

 

Path:  /Liberator/MacroGen_1/

 

Insert the following line where shown with arrow:  .lrfm list insert end “MULTIPLIER2”

 

 

File 2:  This file has already been added, just inspect its presence

 

Add the following file to the following directory:

 

/Liberator/MacroGen_1/images

 

File name:  tr_mult2.gif*

 

Note:  This is the file for the image that pops up when you specify a macro of your choice.

 

This file is already been created and inserted, just note that this file is necessary when adding a new macro.

 

 

File 3:  This File has already been added, review its source code

 

Add the following file to the following directory:

 

/Liberator/MacroGen_1/macro_templts

 

File name:  multiplier2.vhd

 

Note:  This is the actual source code that is being optimized.

 

File 4:

Edit the following file in the directory:     /Liberator/MacroGen_1/scripts

 

Edit the file:  MULTIPLIER2*

 

Change the paths to your working directory of the file located on lines 54 and 95.  These line numbers are shown in the following image.  For example, mine is; /home/jhatche2/652/Liberator…….

 

 

 

 

 

File 5:

 

Path of file:     /Liberator/MacroGen_1/scripts

 

Edit the file:  prl_multiplier2

 

Change the path to your working directory.

 

 

 

 

 

File 6:

 

In the main Liberator Directory, edit the file:      install*

 

Add the following lines where shown in the following screen shot.

 

Lines to add:  

perl -pi  -e  'open(FILE,"w"); $p=<FILE>; close FILE; s/#wish_path#/$p/g'  ./MacroGen_1/scripts/MULTIPLIER2

 

perl -pi  -e  'open(FILE,"p"); $p=<FILE>; close FILE; s/#perl_path#/$p/g'  ./MacroGen_1/scripts/prl_multiplier2

 

perl -pi  -e  'open(FILE,"p"); $p=<FILE>; close FILE; s/#perl_path#/$p/g'  ./templates/MULTIPLIER2/deneme

perl -pi  -e  'open(FILE,"p"); $p=<FILE>; close FILE; s/#perl_path#/$p/g'  ./templates/MULTIPLIER2/iterate

 

 

 

 

 

 

 

 

 

 

In the main Liberator Directory, edit the file:      team_liberator*

 

First, add the following line below line 76 as shown in the below screenshot. 

 

Add line:   .macrogen.lfrm.list insert end "MULTIPLIER2"

 

 

next add the following line at line 1710: 

 

                            set kk6 [string compare "MULTIPLIER2" $mmc]

 

and add the following lines to line 1733:

 

                        if { $kk6 == 0 } {

set mmc1 multiplier2

            }

 

 

Next, change the directory to your working directory on line 105; refer to the screen shot below:

 

 

 

 

***There have also been many files that were added to the liberator directory so that the added macro could function.  Please review these files to make sure that you understand them.

 

Additional Files to review:

 

Directory:                                                                   Filename:

/Liberator/MacroGen_1/images                              tr_mult2.gif

 

/Liberator/MacroGen_1/macro_templts                  multiplier2.vhd*

 

/Liberator/MacroGen_1/scripts                              MULTIPLIER2*

 

/Liberator/MacroGen_1/scripts                              prl_multiplier2*

 

/Liberator/templates                                                MULTIPLIER2/

 

 

After you have altered the specified files above, invoke the Liberator environment as was done in hw 5:

 

Change directory to the main directory of Liberator:    /Liberator

 

 

*****Invoke the Gui by typing the following:

 

source ~cad/.cshrc

synopsys_tools

./team_liberator &

 

 

 

 

*****Generate the VHDL file:

 

Click "MACROLIST" to see the list of available macros;

Double click the added macro, "multiplier2";

Input the parameters for the macro (e.g. 8, 0 or 1), click "GENERATE", then "EXIT";

Click "VHDL" to see the auto-generated VHDL code

 

 

                                  ***Capture screenshots***     

 

*Notice in the above screen shots, the presence of the added macro, “MULTIPLIER2.”

 

 

Note: It is not necessary to run the optimization, it should work the same way as part A on HW 5.

 

 

                                             

 

Congratulations, you have just added a new macro to the Liberator Toolset!!!!!!!!!!!!!