This exercise will be divided into two parts and, at the end of it, you should be able to:
Attention: All the files you need for this activity are available at / home / staff / rodolfo / mc723 / download.
mips-elf-gcc programa.c -the -specs = archc program
Download the MIPS processor model for ArchC 2.0 beta1 available on the ArchC (Attention, download the specific version for ArchC 2.0 beta1). Also download the SPARC model and recompile your program to run on SPARC. Do same for PowerPC. Tip: create different executables, one for each processor, with different names. Note: Any program can be a simple program.
Use the debugging tools with your processor (gdb) to run the code. Finally, check the organization of the executables (code memory addresses) with the objdump utility (there is a specific version for each processor, mips-elf- objdump, sparc-elf-objdump and powerpc-elf-objdump). The focus at this point is familiarization with the tools available.
There are several levels of modeling in SystemC. One of the highest is the TLM (see the TLM 1.0 manual on the SystemC website or in my IC3 homedir), which we will use in this exercise. A very simple definition of TLM means that everything that is done on the circuit is done through function calls, as opposed to conventional hardware description languages that use signals. for passing data between components.
Above SystemC, the language will be used ArchC, which was developed to describe processors. The purpose of using ArchC at this stage is only to generate processors to be used in the simulators. At the moment, emphasis will not be placed on language constructions. There are models of MIPS and SPARC processors in ArchC ready to be used. To work on this exercise, a newer version of ArchC than the one available on the site will be used. There is a file called archc-svn-src.tgz
in my homedir for anyone who wants to install outside the IC.
Consult all the manuals above to answer questions. There is also a SystemC + TLM + ArchC tutorial in my course directory. The tutorial is in a preliminary version. Please do not post online.
To manage all of the above, there is the ARP utility which, together with a hierarchy of directories, allows platforms to be created (= set of hardware components + processor + software). The use of ARP is the focus of this exercise. All activities will be done on it. To install it, just unzip the file arp-base.tgz and follow the instructions in the INSTALL and README files. Note: You must install ARP somewhere where you have write permissions, as SystemC, ArchC and TLM can be used directly from my homedir.
One of the facilities of ARP is to be able to pack and unpack components and platforms. For that, there are the parameters --pack
e --unpack, respectively. The standard version of the ARP comes with working tools only. The first activity is to unpack the example helloworld_mips.01.arp.pack. Before running, edit the Makefile file in the ARP root directory and correctly set the environment variables for the locations where SystemC, TLM and ArchC were installed (you can use the versions that are installed in / home / staff / rodolfo / mc723 / ...). Also define the name of the platform to be simulated (helloworld_mips.01)
./arp --unpack /home/staff/rodolfo/mc723/download/helloworld_mips.01.arp.pack
make
make run-bin
If the Makefile file was set up correctly according to the README and INSTALL instructions, the example should write a message on the screen after compiling all the components.
Its activity is to use the SPARCv8 processor to do exactly the same task as in Part 2. The package sparcv8-archc2x-branch.arp.pack
is in my homedir with the processor (only the processor, without hello.c). Create another platform using the SPARC processor instead of MIPS. To change the processor, you must edit the file defs.arp to exchange MIPS for SPARC and change the main.cpp to also exchange MIPS for SPARC. This will change the platform. To change the software, also replicate the software directory and change the compiler being used (from MIPS to SPARC).
After running the same hello world, replace the program with another one (creating another directory in the software directory). Create and run the program you want.
Finally, change the memory module to display access information on the screen. All access attempts must be computed (read and write) and she must write a message after every 100 or 1000 accesses. To do this, copy the memory module directory under another name and make your changes to that new directory.