// // SoC P35 Exercise 2 2014/15. // // Please do the following 1. Create another version of PERIPHERAL_DEVICE which is a coded as a transactional modelling `target'. Note: It is easiest if you use the TLM-1 style coding or the toy generic payload from the TOY-ESL classes for this exercise but feel free to use the TLM 2.0 library (as used in the Prazor reference design) instead (you may have a few problems with TLM 2.0 linking and if so DJG will be very happy to help you.) Note: you do not need to include any timing or power annotations. 2. Create a test for the TLM version of PERIPHERAL_DEVICE. This can be as trivial as you like, such as just a couple of reads or writes to its registers. Or you may wish to port the test from Exericse 1. The test should be separate (in a different file or class) from the PERIPHERAL_DEVICE model. Note: your test may be a standalone test wrapper or it may be a program running on a processor model such as the nominal processor from the toy classes (or on the Prazor simulator if you are speeding onwards). 3. Somehow compare the performance of your answers to Exercises 1 and 2. For instance, you might make the testbench loop for 10^7 times and using the program under the unix 'time' command. Your answer will typically be in terms of time to simulate a programmed I/O cycle. Include a discussion of how many interactions there with the SystemC event kernel per I/O cycle. Note: You don't have to run the same testbench in both cases, but clearly you will then have to estimate some correction factor to get a comparable performance figure. Note: Make sure you use the same level of C++ optimisation for both (such as -O2). Note: Take a note of the bogomips given in /proc/cpuinfo for you simulation workstation/laptop. Optional extensions (no formal credit): 4a. If you chose to do this in TLM 1.0 style, or in the TLM 2.0 style of the TOY ESL classes, create a Transactor that, when combined with your answer from Exercise 1 gives something that offers the same TLM interface as your answer to part 1 of Exercise 2. In fact, you might wish to do this step first. The Transactor should itself be a SystemC module. 4b. If you chose to do this in TLM 2.0 style, and you are already able to build your own copy of Prazor, modify the platform file in Prazor to instantiate your peripheral. The file(s) you would need to change is/are /usr/groups/han/clteach/btlm/current/vhls/src/platform/arm/zynq/parallella/zynq{.cpp,.h} Look at the way an existing I/O device is wired in, such as the UART. You can see it is connected to the I/O bus iwht the following line BUSMUX64_BIND(busmux0, UARTS[uu]->port0, start, UART_SPACING) and PERIPHERAL_DEVICE can be connected to busmux0 with an additional, similar such call. As before, include your source code and examples outputs in your report. Questions: There are no additional questions to answer in this exercise, but make sure you compare the performance. END