HOME       UP       PREV       NEXT (Toy Class 5 : Multiple Bus Masters)  

Toy Class 4 : ESL-style 'Wiring'

Aim:In class 4 we look at the TLM version of nominalproc and the TLM version of the RAM tlmram32.h.

We also look at the tiny Quantum Keeper embedded in the TLM version of nominal processor.

We look at how the memory models can be called in both a TLM style and an RTL style from a TLM style implementation of nominalproc.

Class 4: Provided Compilation Targets

The tlm-onecpucore.cpp is unmodified at the start, still instantiating the RTL memory components.

Then it instantiates a TLM processor, memory and busmux.

It is left as Exercise 1 below to write a transactor that connects the TLM processor to the instantiated RTL parts so that they too can be used.

Class 4: Optional Exercises

Exercise 1:

Write and instantiate a transactor that connects the TLM processor to RTL-style components of the last class. This gives us a mixed abstraction simulation. The transactor is best implemented as its own SystemC module instantiated alongside the components it connects.

Exercise 2:

Introduce a high-level model of a new peripheral of your own design and a device driver for it into the system. Each can be entirely trivial: it will still demonstrate the coding style.

You may replace one of the memory blocks with your peripheral or else add a further bus multiplexor and connect the peripheral along side the exisiting memory blocks. Or, to make it really easy, you can just pretend one of the memory blocks is your perhipheral.

Then modify the test program loaded into the nominal processor to run a cycle or two on your new peripheral.

Finally, sketch some typical device driver code for your new peripheral and show how you could make a 'mid-level model' where the device driver calls the code of the peripheral directly. Ideally you can reuse the same body of code in various places with conditional compilation using the C++ preprocessor to adjust the level of detail.


4: (C) 2008-17, DJ Greaves, University of Cambridge, Computer Laboratory.