- Go to
RTL Generation
directory, open terminal and type any of the following command as per the requirement:
- For Generating APB Template:
$python3 csv_render_mako.py ../CSV\ Files/csv_file_name.csv apb_slave.v.mako > apb_slave.v
- For Generating AHB Template:
$python3 csv_render_mako.py ../CSV\ Files/csv_file_name.csv ahb_slave.v.mako > ahb_slave.v
Here, replace csv_file_name.csv with the name of the CSV file you want to use.
Note: Make sure ldc2 compiler is installed for proper compilation of the D files.
- Compile the D files of the template
csv2reg.d
andcsv2regsv.d
present in theRAL Model Generation
directory by running following command:
$ldc2 csv2reg.d
$ldc2 csv2regsv.d
- Now to generate the RAL models using given specification file, run following command:
For Register Model in D:
$./csv2reg ../CSV\ Files/csv_file_name.csv csv_file_name > demo_reg_model_d.d
For Register Model in SV:
$./csv2regsv ../CSV\ Files/csv_file_name.csv csv_file_name > demo_reg_model_sv.sv
For example for the specification sheet demo_reg.csv provided with this code, the command will be:
For Register Model in D:
$./csv2reg demo_reg.csv demo_reg > demo_reg_model_d.d
For Register Model in SV:
$./csv2regsv demo_reg.csv demo_reg > demo_reg_model_sv.sv
Now these files which are generated can be used for further use in the Project.