MC723: ARP tutorial on IC-3

Using a virtual platform

A virtual platform is software capable of simulating hardware with a good level of detail. It is generally not necessary to modify programs that run on this virtual platform to run them on a real platform (hardware). Some components existing on real platforms do not appear in virtual versions in order to not affect performance. Other components appear with very simplified versions. However, the software running on this virtual platform should hardly be able to notice this difference. Examples of these components that may appear differently are: caches (which may not exist), peripherals (which can only emulate what they should be doing), etc.

In this tutorial, you will use the ARP (ArchC Reference Platform) package to manage platforms. ARP is nothing more than a set of Makefiles and a directory structure to facilitate the development of larger projects. Each directory has specific content:

Take the example platform (/home/staff/rodolfo/mc723/downloads/arp-rodolfo.tgz), unzip it and browse the directories observing the content of each one. Although there is an unzipped version of the ARP in my homedir, you should start with the empty version indicated above. To run the platform, just use the commands:

make make run

The first command compiles the platform and the second executes it. If it is necessary to compile the program, you must use the compiler installed in / home / staff / rodolfo / compilers / bin, as in the previous project. For ease, include the previous path in the PATH before executing the two commands above.

This simulator is slower than the previous one because it contains more components than you were used to.

Can you run another program? You need to create a directory in the sw folder and also configure the defs.arp file in the platform folder.

Based on the platform above, you must include a bus between the processor and the memory. The code of this bus must be placed in the is folder of the platform. Use one of the programs you have already run.

See a little more details below, about the platform, before the recommendations for your code.

Its first platform had only two modules: a processor and a memory. Now it's time to add a third module, the bus, which will play the role of interconnecting the system. It will be simplified at the moment.

The communication between the processor and the memory is done through the TLM standard, which basically performs the connection between the system components. However, the TLM standard is point-to-point, requiring a port on each side for each communication channel. In addition, TLM includes the concept of master and slave, where the master always makes requests and the slave only answers them. In the original case, the processor is the master and the memory is a slave. The big problem with this initial configuration is the difficulty in including a new peripheral, as it will be necessary to modify the processor so that it communicates with two different devices. So, the solution is to include a peripheral in the middle of the path that will only do the routing role, this is the bus you are going to do.

From the TLM point of view, connections are always made between ports, the processor has a Master port and the memory has a Slave port. In the main program (main.cpp of the platform), you see the connection between the processor and the memory through the line:

mips1_proc1.DM_port (mem.target_export);

this line connects the DM_port port of the processor to the target_export port of the memory. Looking a little earlier at this code, you can see the declaration of the mips1_proc1 processor and the mem memory. Your task is to create a new component, called a router, which will be connected to mips1_proc1 and also to mem. For this, he will need to be a Slave in his connection to the processor and a Master in his connection to the memory. In addition, all requests from the processor must be transferred to memory at this time.

The simplest way to implement this bus is to start with the memory code, removing the part related to data storage and including the part of the Master connection that you can follow the example of the processor code (look for the declaration of the mips1 class). you will always work around and implementing the transport method.

In this activity, you are expected to find and assemble the correct code for your router. All source code examples are already given.

In the next few steps, you should be able to start all processors on your system. A simple way to start execution is to determine what characteristics the processors need to start separately. Note that you can configure each processor and create more processors in the main platform file.