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. It will be exactly the same package that you will use for the rest of the semester to carry out the other experiments. 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 (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 / l / archc / compilers / bin on the xaveco machine (the compiler is only there, you can run the programs compiled on any other machine, but the compilers for MIPS are only in xaveco). 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. Insert a router between the processor and the platform

Based on the platform above, you must include a router between the processor and the memory. The code for this router 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 router, which will act as the system's bus. It is being called a router because it will not implement the features of containing traffic on a bus, nor some other interesting features. So you will be working with something simplified at this point.

The communication between the processor and the memory is done through the TLM standard, which basically performs the connection between the system components. But the TLM standard is point-to-point, requiring a port on each side for each communication channel. In addition, the 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 router that you will 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 router 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.