This page explains the makefile for cmpiling the
systemc simple bus example.
-
Recently I started to study the simple bus example from the
systemc installation.
-
After reading the detailed read me and slides
I wanted to compile the example, but there was no makefile. So I
created one.
Next I found that there are some minor compilation
errors.
-
This page will describe the makefile as well as the
minor changes, which were required.
-
The header file, simple_bus_request.h, needed to be
slightly modified (see highlighted lines):
#ifndef __simple_bus_request_h
#define __simple_bus_request_h
//Pini
#include "tlm.h"
#include "simple_bus_types.h"
...
// request status
//Pini
sc_core::sc_event transfer_done;
...
-
The makefile can be seen, as plain text, from this
link.
Note c_list, which is mentioned in the makefile, is discussed in:
e_search_P
and gcc dependency files is discussed at
dedependency.
The compiler is given the -MD option, to create dependency files. A perl
script extracts all file to a list. The list has to be sorted and unique (pipe
sort | uniq commands).
To run the porgram, just type:
make run.exe. If debugger is needed, use
make DBG_OPT="gdb " run.exe.
-
For this project I found that using gdb to create the
the loaded list file is better. From the gdb command
line first direct output to a file:
set logging on
then issue the command to list all files:
info sources
and stop the gdb file log:
set logging off
Open the file with vi and run the following
script from within vi by
:%!perl ~/in/vim_gdb_info_src.pl
vim script.
:%!sort
:%!uniq
To summarize the script removes ',' as well as
multiple spaces, at the end of line. If it finds
two or more files in a line, it will split them into
a single file in a line.
To remove repetitions, sort and uniq linux commands
are executed,
from within VIM on the entire text.
|