Examples: MP System
To download zipped file for this design use this link: mp_system.zip
Open downloaded mp_system.gbl project file in GBL Designer. The project contains the following four modules:
Module processor
Processor module contains 3 registers: ip_register - instruction pointer, register1 and register2 - common data registers. The Process fiber contains a simple instruction set for this processor.
Module arbiter
Arbiter contains two fibers ProcessRequest1 and ProcessRequest2, which wait on busy signal to determine when to grant processors access to data bus. As soon as bus becomes availible, arbiter sends corresponding bus_grant signal to the requesting processor allowing access to the bus for one cycle.
Module memory_controller
Memory controller simulates access to RAM. In this example RAM consists of 256 8-bit words. RAM is filled with random numbers on system reset.
Module test
Test module contains two processors, arbiter, memory controller, and ClockGen module from BasicModules.

Set Trace File property for test module to save traces to the selected file. After you build and run test module open the trace file in Tracer. You will see waveforms similar to the picture below. Due to the fact that different compilers implement random number generators differently you may observe different waveforms.

You can modify this example to use threads instead of fibers. You will need to apply proper locking for shared resources. Also due to non-deterministic nature of threads the results will vary on each run.

Traces generated when using Visual Studio 2010 compiler.

Copyright © 2010, GB Research LLC. All Rights Reserved.