Use the framework available in VisualSim to explore the architecture of a multi-core processor system for the following objectives:
We consider a system comprising a single core/dual core processor. A
traffic generator sends application specific transactions to a target
processor. In addition, we consider a main memory across a shared bus.
Two block diagrams depicting the system using a single as well as dual core processor are show below.
Refer Fig 3 (Singe Core) and Fig 4 (Dual Core) for the intended VisualSim model.
Figure 3: Single Core VisualSim Model
Figure 4: Dual Core VisualSim Model
The procedures outlined below makes the following assumptions:
The following table list the blocks to be used in this model.
S.No. |
Library Block |
Description |
1 |
Digital Simulator
|
The Digital
Simulator implements the discrete-event Model of Computation (MoC). The
simulator maintains a notion of current time, and processes events
chronologically in this time. Used to model elements that change with
time such as hardware, software and networks. Click here for detailed description and examples. |
2 |
Traffic
|
Outputs a
new Data Structure (DS) at time intervals specified by the
"Time_Distribution" setting. A Data Structure is also knowns as a
transaction and contains a list of Field Names + Values. Click here for detailed description and examples. |
3 |
InstructionSet
|
Creates instruction references for the processor. Click here for further details. |
4 |
ExpressionList
|
Executes a sequence of expressions in order. The default block contains one input and one output. The user can add multiple input and output ports. Click here for detailed description and examples. |
5 |
Processor
|
Models
variations of commercial and proprietary processors. Gets accurate
timing, data flow, throughput, and power consumption of the processor. |
6 |
Dynamic Mapper
|
Enables the mapping of behavior, task, or function on a target processor. Click here for further details. |
7 |
Text_Display
|
Displays the values arriving on the input port in a text display dialog. Click here for detailed description and examples. |
8 |
TimeDataPlotter
|
Plots the incoming
data on the Y-Axis against the current simulation time on the X-axis.
Every wire connected to this block input is considered a separate
dataset and plotted separately. Click here for detailed description and examples. |
9 |
BusArbiter
|
The Bus Arbiter block is the Arbiter for a Bus Interface. Click here for further details. |
10 |
BusInterface
|
Connects devices to the BusArbiter and has a queue for each port. Click here for further details. |
11 |
RAM
|
Combines the operation of a
basic memory controller (delay function) and the memory array. Handles
pre-fetch, read, write, refresh, and controller operations. Click here for further details. |
12 |
ArchitectureSetup
|
Handles all the address mapping, routing, plotting, statistics, and debugging for the hardware modeling components. Click here for further details. |
13 |
Cache
|
Emulates a cache in an architectural model. There are interfaces on both side of the block for connectivity. Click here for further details. |
14 |
ResourceStatistics
|
Outputs or resets the statistics for all the SystemResource, Channel, Channel_N, Server, and Queues in the model. Click here for further details. |
15 |
Timing Diagram
|
Enables the user to view a Gantt chart of the activity associated with the main architecture devices. Click here for further details. |
16 |
Task Generator
|
Generates new tasks to execute
on the processor. The mix of instructions in the task is read from the
file that is referenced by the parameter Read_My_Instruction_Mix_Table. Click here for further details. |
We consider the following two scenarios while building this model.
In the initial setup, you set the model parameters, drag and drop a Digital Simulator, and define an Instruction Set for the processors.
Figure 5: Parameters
Figure 6: Digital Simulator
Figure 7: Digital Simulator Parameters
Figure 8: Instruction Set
/* Instruction Set or File Path. */ Mnew Ra Rb Rc Rd Re ; /* Label */ EXE IU FPU ; IU INT_1 ; FPU FP_1 ; begin INT_1 ; /* Group */ add 1 ; mul 1 ; div 2 ; sub 1 ; end INT_1 ; begin FP_1 ; /* Group */ fadd 3 ; fmul 3 ; madd 3 ; fdiv 17 ; fsub 12 ; end FP_1 ; |
Figure 9: Instruction Set Parameters
In this stage, you configure blocks to represent the architectural elements - Processors, Bus, Cache, and RAM.
Note: We consider a dual core processor for this tutorial. The procedures for a single core processor remain the same and you use only a single processor block.
/* First row contains Column Names. */ Parameter_Name Parameter_Value ; Processor_Instruction_Set: Instruction_Set ; Number_of_Registers: 32 ; Processor_Speed_Mhz: Processor_Clock ; Context_Switch_Cycles: 100 ; Instruction_Queue_Length: 6 ; Number_of_Pipeline_Stages: 4 ; Number_of_INT_Execution_Units: 1 ; Number_of_FP_Execution_Units: 1 ; Number_of_Cache_Execution_Units: 2 ; I_1: {Cache_Speed_Mhz=Processor_Clock, Size_KBytes=16.0, Words_per_Cache_Line=16, Cache_Miss_Name=L2_Cache} D_1: {Cache_Speed_Mhz= Processor_Clock, Size_KBytes=16.0, Words_per_Cache_Line=16, Cache_Miss_Name=L2_Cache} |
/* First row contains Column Names. */ Stage_Name Execution_Location Action Condition ; 1_PREFETCH I_1 instr none ; 1_PREFETCH D_1 read none ; 2_DECODE I_1 wait none ; 3_EXECUTE D_1 wait none ; 3_EXECUTE EXE exec none ; 4_STORE EXE wait none ; 4_STORE D_1 write none ; |
/* First row contains Column Names. */ Source_Node Destination_Node Hop Source_Port ; Processor_1 Cache_1 Port_1 bus_out2 ; Cache_1 Processor_1 Port_2 output ; Cache_1 SDRAM_1 Port_2 output ; SDRAM_1 Cache_1 Port_4 output ; SDRAM_1 Processor_1 Port_4 output ; |
Parameter |
DynamicMapper |
DynamicMapper2 |
Block_Name |
Task_Mapper_1 |
Task_Mapper_2 |
Database_Lookup |
none |
none |
Database_Expression |
none |
none |
Task_Name |
A_Task_Name |
A_Task_Name |
Task_Destination |
Architecture_1.Processor_1 |
Architecture_1.Processor_2 |
Task_Instruction |
A_Instruction |
A_Instruction |
Task_ID |
1 |
1 |
Task_Plot_ID |
1 |
1 |
Task_Priority |
1 |
1 |
Task_Time |
none |
none |
DISPLAY AT TIME ------ 100.0000000000 ms ------ {BLOCK = ".Processor_Modeling_Part1.ArchitectureSetup", Bus_1_Delay_Max = 2.6154000007383E-8, Bus_1_Delay_Mean = 2.1950571428453E-8, Bus_1_Delay_Min = 2.1249999995754E-8, Bus_1_Delay_StDev = 1.7160425282895E-9, Bus_1_IOs_per_sec_Max = 16000.0, Bus_1_IOs_per_sec_Mean = 16000.0, Bus_1_IOs_per_sec_Min = 16000.0, Bus_1_IOs_per_sec_StDev = 0.0, Bus_1_Input_Buffer_Occupancy_in_Words_Max = 31.0, Bus_1_Input_Buffer_Occupancy_in_Words_Mean = 8.6266840504129, Bus_1_Input_Buffer_Occupancy_in_Words_Min = 0.0, Bus_1_Input_Buffer_Occupancy_in_Words_StDev = 8.0148255065604, Bus_1_Preempt_Buffer_Occupancy_in_Words_Max = 0.0, Bus_1_Preempt_Buffer_Occupancy_in_Words_Mean = 0.0, Bus_1_Preempt_Buffer_Occupancy_in_Words_Min = 0.0, Bus_1_Preempt_Buffer_Occupancy_in_Words_StDev = 0.0, Bus_1_Throughput_MBs_Max = 0.448, Bus_1_Throughput_MBs_Mean = 0.448, Bus_1_Throughput_MBs_Min = 0.448, Bus_1_Throughput_MBs_StDev = 0.0, DELTA = 0.0, DRAM_Delay_Time_Max = 2.3076923076923E-8, DRAM_Delay_Time_Mean = 1.3076923076923E-8, DRAM_Delay_Time_Min = 3.0769230769231E-9, DRAM_Delay_Time_StDev = 1.0E-8, DRAM_Memory_Used_By_Processor_1_MB_Max = 0.003712, DRAM_Memory_Used_By_Processor_1_MB_Mean = 0.003264, DRAM_Memory_Used_By_Processor_1_MB_Min = 0.002816, DRAM_Memory_Used_By_Processor_1_MB_StDev = 4.48E-4, DRAM_Memory_Used_By_Processor_2_MB_Max = 0.003584, DRAM_Memory_Used_By_Processor_2_MB_Mean = 0.003136, DRAM_Memory_Used_By_Processor_2_MB_Min = 0.002688, DRAM_Memory_Used_By_Processor_2_MB_StDev = 4.48E-4, DRAM_Memory_Used_By_Total_MB_Max = 0.0064, DRAM_Memory_Used_By_Total_MB_Mean = 0.0064, DRAM_Memory_Used_By_Total_MB_Min = 0.0064, DRAM_Memory_Used_By_Total_MB_StDev = 0.0, DRAM_Throughput_MBs_Max = 0.128, DRAM_Throughput_MBs_Mean = 0.128, DRAM_Throughput_MBs_Min = 0.128, DRAM_Throughput_MBs_StDev = 0.0, DS_NAME = "Architecture_Stats", ID = 2, INDEX = 0, L2_Cache_Delay_Time_Max = 2.0E-8, L2_Cache_Delay_Time_Mean = 1.4642857142857E-8, L2_Cache_Delay_Time_Min = 1.25E-9, L2_Cache_Delay_Time_StDev = 8.470386589737E-9, L2_Cache_Hit_Ratio_Max = 98.0, L2_Cache_Hit_Ratio_Mean = 97.7142857142857, L2_Cache_Hit_Ratio_Min = 97.4285714285714, L2_Cache_Hit_Ratio_StDev = 0.2857142857127, L2_Cache_Memory_Used_By_DRAM_MB_Max = 0.0064, L2_Cache_Memory_Used_By_DRAM_MB_Mean = 0.0064, L2_Cache_Memory_Used_By_DRAM_MB_Min = 0.0064, L2_Cache_Memory_Used_By_DRAM_MB_StDev = 0.0, L2_Cache_Memory_Used_By_Processor_1_MB_Max = 0.00928, L2_Cache_Memory_Used_By_Processor_1_MB_Mean = 0.00816, L2_Cache_Memory_Used_By_Processor_1_MB_Min = 0.00704, L2_Cache_Memory_Used_By_Processor_1_MB_StDev = 0.00112, L2_Cache_Memory_Used_By_Processor_2_MB_Max = 0.00896, L2_Cache_Memory_Used_By_Processor_2_MB_Mean = 0.00784, |
L2_Cache_Memory_Used_By_Processor_2_MB_Min = 0.00672, L2_Cache_Memory_Used_By_Processor_2_MB_StDev = 0.00112, L2_Cache_Memory_Used_By_Total_MB_Max = 0.0224, L2_Cache_Memory_Used_By_Total_MB_Mean = 0.0224, L2_Cache_Memory_Used_By_Total_MB_Min = 0.0224, L2_Cache_Memory_Used_By_Total_MB_StDev = 0.0, L2_Cache_Throughput_MBs_Max = 0.328, L2_Cache_Throughput_MBs_Mean = 0.328, L2_Cache_Throughput_MBs_Min = 0.328, L2_Cache_Throughput_MBs_StDev = 0.0, Processor_1_Context_Switch_Time_Pct_Max = 0.005858, Processor_1_Context_Switch_Time_Pct_Mean = 0.005151, Processor_1_Context_Switch_Time_Pct_Min = 0.004444, Processor_1_Context_Switch_Time_Pct_StDev = 7.07E-4, Processor_1_D_1_Hit_Ratio_Max = 0.0, Processor_1_D_1_Hit_Ratio_Mean = 0.0, Processor_1_D_1_Hit_Ratio_Min = 0.0, Processor_1_D_1_Hit_Ratio_StDev = 0.0, Processor_1_D_1_KB_per_Thread_Max = 0.0, Processor_1_D_1_KB_per_Thread_Mean = 0.0, Processor_1_D_1_KB_per_Thread_Min = 0.0, Processor_1_D_1_KB_per_Thread_StDev = 0.0, Processor_1_I_1_Hit_Ratio_Max = 100.0, Processor_1_I_1_Hit_Ratio_Mean = 44.4444444444444, Processor_1_I_1_Hit_Ratio_Min = 0.0, Processor_1_I_1_Hit_Ratio_StDev = 49.6903994999953, Processor_1_I_1_KB_per_Thread_Max = 0.0, Processor_1_I_1_KB_per_Thread_Mean = 0.0, Processor_1_I_1_KB_per_Thread_Min = 0.0, Processor_1_I_1_KB_per_Thread_StDev = 0.0, Processor_1_Stall_Time_Pct_Max = 0.001856, Processor_1_Stall_Time_Pct_Mean = 0.001632, Processor_1_Stall_Time_Pct_Min = 0.001408, Processor_1_Stall_Time_Pct_StDev = 2.24E-4, Processor_1_Task_Delay_Max = 1.4499900000131E-7, Processor_1_Task_Delay_Mean = 1.1955455555611E-7, Processor_1_Task_Delay_Min = 1.0499899999461E-7, Processor_1_Task_Delay_StDev = 1.5341382750109E-8, Processor_2_Context_Switch_Time_Pct_Max = 0.005656, Processor_2_Context_Switch_Time_Pct_Mean = 0.004949, Processor_2_Context_Switch_Time_Pct_Min = 0.004242, Processor_2_Context_Switch_Time_Pct_StDev = 7.07E-4, Processor_2_D_1_Hit_Ratio_Max = 0.0, Processor_2_D_1_Hit_Ratio_Mean = 0.0, Processor_2_D_1_Hit_Ratio_Min = 0.0, Processor_2_D_1_Hit_Ratio_StDev = 0.0, Processor_2_D_1_KB_per_Thread_Max = 0.0, Processor_2_D_1_KB_per_Thread_Mean = 0.0, Processor_2_D_1_KB_per_Thread_Min = 0.0, Processor_2_D_1_KB_per_Thread_StDev = 0.0, Processor_2_I_1_Hit_Ratio_Max = 100.0, Processor_2_I_1_Hit_Ratio_Mean = 44.4444444444444, Processor_2_I_1_Hit_Ratio_Min = 0.0, Processor_2_I_1_Hit_Ratio_StDev = 49.6903994999953, Processor_2_I_1_KB_per_Thread_Max = 0.0, Processor_2_I_1_KB_per_Thread_Mean = 0.0, Processor_2_I_1_KB_per_Thread_Min = 0.0, Processor_2_I_1_KB_per_Thread_StDev = 0.0, Processor_2_Stall_Time_Pct_Max = 0.001792, Processor_2_Stall_Time_Pct_Mean = 0.001568, Processor_2_Stall_Time_Pct_Min = 0.001344, Processor_2_Stall_Time_Pct_StDev = 2.24E-4, Processor_2_Task_Delay_Max = 1.4499900000131E-7, Processor_2_Task_Delay_Mean = 1.1955455555573E-7, Processor_2_Task_Delay_Min = 1.0499899999461E-7, Processor_2_Task_Delay_StDev = 1.5341382750299E-8, TIME = 0.1} |
DISPLAY AT TIME ------ 100.0000000000 ms ------ { Processor_1_Context_Switch_Time_Pct_Max = 0.004848, Processor_1_Context_Switch_Time_Pct_Mean = 0.004848, Processor_1_Context_Switch_Time_Pct_Min = 0.004848, Processor_1_Context_Switch_Time_Pct_StDev = 0.0, Processor_1_D_1_Hit_Ratio_Max = 0.0, Processor_1_D_1_Hit_Ratio_Mean = 0.0, Processor_1_D_1_Hit_Ratio_Min = 0.0, Processor_1_D_1_Hit_Ratio_StDev = 0.0, Processor_1_D_1_KB_per_Thread_Max = 0.0, Processor_1_D_1_KB_per_Thread_Mean = 0.0, Processor_1_D_1_KB_per_Thread_Min = 0.0, Processor_1_D_1_KB_per_Thread_StDev = 0.0, Processor_1_I_1_Hit_Ratio_Max = 100.0, Processor_1_I_1_Hit_Ratio_Mean = 80.0355859590934, Processor_1_I_1_Hit_Ratio_Min = 0.0, Processor_1_I_1_Hit_Ratio_StDev = 39.7193069184094, Processor_1_I_1_KB_per_Thread_Max = 0.0, Processor_1_I_1_KB_per_Thread_Mean = 0.0, Processor_1_I_1_KB_per_Thread_Min = 0.0, Processor_1_I_1_KB_per_Thread_StDev = 0.0, Processor_1_Stall_Time_Pct_Max = 0.011006, Processor_1_Stall_Time_Pct_Mean = 0.010885, Processor_1_Stall_Time_Pct_Min = 0.010764, Processor_1_Stall_Time_Pct_StDev = 1.2100000000002E-4, Processor_1_Task_Delay_Max = 5.7299900000155E-7, Processor_1_Task_Delay_Mean = 3.2370287645205E-7, Processor_1_Task_Delay_Min = 1.0499899999461E-7, Processor_1_Task_Delay_StDev = 1.2443263817956E-7, Processor_2_Context_Switch_Time_Pct_Max = 0.005252, Processor_2_Context_Switch_Time_Pct_Mean = 0.005252, Processor_2_Context_Switch_Time_Pct_Min = 0.005252, Processor_2_Context_Switch_Time_Pct_StDev = 0.0, | Processor_2_D_1_Hit_Ratio_Max = 0.0, Processor_2_D_1_Hit_Ratio_Mean = 0.0, Processor_2_D_1_Hit_Ratio_Min = 0.0, Processor_2_D_1_Hit_Ratio_StDev = 0.0, Processor_2_D_1_KB_per_Thread_Max = 0.0, Processor_2_D_1_KB_per_Thread_Mean = 0.0, Processor_2_D_1_KB_per_Thread_Min = 0.0, Processor_2_D_1_KB_per_Thread_StDev = 0.0, Processor_2_I_1_Hit_Ratio_Max = 100.0, Processor_2_I_1_Hit_Ratio_Mean = 80.166475315729, Processor_2_I_1_Hit_Ratio_Min = 0.0, Processor_2_I_1_Hit_Ratio_StDev = 39.6057602585533, Processor_2_I_1_KB_per_Thread_Max = 0.0, Processor_2_I_1_KB_per_Thread_Mean = 0.0, Processor_2_I_1_KB_per_Thread_Min = 0.0, Processor_2_I_1_KB_per_Thread_StDev = 0.0, Processor_2_Stall_Time_Pct_Max = 0.011776, Processor_2_Stall_Time_Pct_Mean = 0.01169, Processor_2_Stall_Time_Pct_Min = 0.011604, Processor_2_Stall_Time_Pct_StDev = 8.6000000000108E-5, Processor_2_Task_Delay_Max = 5.7299900000501E-7, Processor_2_Task_Delay_Mean = 3.2205382204324E-7, Processor_2_Task_Delay_Min = 1.0499899999461E-7, Processor_2_Task_Delay_StDev = 1.2373799043996E-7, TIME = 0.1} |
Processor_1_PROC_Utilization_Pct_Max = 2.64, Processor_1_PROC_Utilization_Pct_Mean = 2.64, Processor_1_PROC_Utilization_Pct_Min = 2.64, Processor_1_PROC_Utilization_Pct_StDev = 0.0, Processor_1_Pipeline_Utilization_Pct_Max = 4.54, Processor_1_Pipeline_Utilization_Pct_Mean = 4.54, Processor_1_Pipeline_Utilization_Pct_Min = 4.54, Processor_1_Pipeline_Utilization_Pct_StDev = 0.0, Processor_1_Stall_Time_Pct_Max = 14.53, Processor_1_Stall_Time_Pct_Mean = 14.53, Processor_1_Stall_Time_Pct_Min = 14.53, Processor_2_Stall_Time_Pct_Max = 14.016, Processor_2_Stall_Time_Pct_Mean = 14.016, Processor_2_Stall_Time_Pct_Min = 14.016, |
Bus_1_Utilization_Pct_Max = 93.7274999999925, Bus_1_Utilization_Pct_Mean = 93.4062499999925, Bus_1_Utilization_Pct_Min = 93.0849999999926, Bus_1_Utilization_Pct_StDev = 0.321249999998, DRAM_Utilization_Pct_Max = 47.1076923076937, DRAM_Utilization_Pct_Mean = 46.8430769230783, DRAM_Utilization_Pct_Min = 46.5784615384629, DRAM_Utilization_Pct_StDev = 0.2646153846157, L2_Cache_Utilization_Pct_Max = 80.4875000000015, L2_Cache_Utilization_Pct_Mean = 79.0325000000015, L2_Cache_Utilization_Pct_Min = 77.5775000000015, L2_Cache_Utilization_Pct_StDev = 1.4549999999998, |
Processor_1_I_1_Hit_Ratio_Max = 100.0, Processor_1_I_1_Hit_Ratio_Mean = 44.4709772226304, Processor_1_I_1_Hit_Ratio_Min = 0.0, Processor_1_I_1_Hit_Ratio_StDev = 49.6887380194589, Processor_2_I_1_Hit_Ratio_Max = 100.0, Processor_2_I_1_Hit_Ratio_Mean = 44.4444444444444, Processor_2_I_1_Hit_Ratio_Min = 0.0, Processor_2_I_1_Hit_Ratio_StDev = 49.6903994999953, |