Design and implement a program to simulate the operation of the SIMMAC based on
ID: 670275 • Letter: D
Question
Design and implement a program to simulate the operation of the SIMMAC based on the descriptions above. Add a HALT instruction that dumps the contents of all registers and memory and then prints an “End of Job” message. Your project must implement multi-tasking in a single queue using a round-robin scheduling discipline. You will implement process entities (jobs) that will allow your machine to run several SIMMAC machine-language programs. In order to do this you will define a Process Control Block (PCB) data structure that will be created for each job in your system. For this assignment assume each SIMMAC instruction is equivalent to one clock cycle. Additionally the time quantum value for round-robin scheduling is an integer multiple of a clock cycle. The quantum value is to be set on the command line or prompted for during initialization.
Explanation / Answer
documentclass[11pt]{article}
usepackage{graphicx} % needed for including graphics e.g. EPS, PS
opmargin -1.5cm % read Lamport p.163
oddsidemargin -0.04cm % read Lamport p.163
evensidemargin -0.04cm % same as oddsidemargin but for left-hand pages
extwidth 16.59cm
extheight 21.94cm
%pagestyle{empty} % Uncomment if don't want page numbers
parskip 7.2pt % sets spacing between paragraphs
% enewcommand{aselinestretch}{1.5} % Uncomment for 1.5 spacing between lines
parindent 0pt % sets leading space for paragraphs
usepackage{listings}
usepackage{color}
egin{document}
egin{figure}[htp]
centering
includegraphics{lte-sim-web.png}
end{figure}
LTE-Sim is an open source framework to simulate LTE networks.
The purpose of this tutorial is to make it easier for new users to use LTE-Sim, to create their own simulation scenarios and to eventually add new functionality to LTE-Sim.
section{Getting LTE-Sim}
LTE-sim is available via Subversion To obtain LTE-Sim, enter into the your preferred folder and
write the following syntax:
color{blue}
egin{lstlisting}
$ svn co http://telematics.poliba.it/svn/LTE-Sim
end{lstlisting}
color{black}
To synchronize the project repository with the local copy, you can run update sub-command. The syntax is as follows:
color{blue}
egin{lstlisting}
$ svn update
end{lstlisting}
color{black}
section{Compiling LTE-Sim}
On Linux systems, you can buil LTE-Sim with the following command:
color{blue}
egin{lstlisting}
$ make
end{lstlisting}
color{black}
To clear the project, you can use the following command:
color{blue}
egin{lstlisting}
$ make clean
end{lstlisting}
color{black}
section{Running LTE-Sim}
In this release several LTE scenarios have been developed as an example. To run a simple simulation, you can use the following command:
color{blue}
egin{lstlisting}
$ ./LTE-Sim Simple
end{lstlisting}
color{black}
Using
color{blue}
egin{lstlisting}
$ ./LTE-Sim -h
end{lstlisting}
color{black}
you can take a look to LTE scenarios we have developed as an example.
section{Software Design} label{design}
egin{figure}[htp]
centering
includegraphics{uml.png}
caption{LTE-Sim - the class diagram}
end{figure}
section{Build a simple scenario} label{simple-scenario}
A basic scenario can be created using the following guidelines:
egin{itemize}
item create an instance for emph{Simulator}, emph{NetworkManager}, emph{FlowsManager}, and emph{FrameManager} components.
item Create emph{Cell}, emph{ENodeB}, and emph{UE} objects using methods of the emph{NetworkManager} class. For each of these objects, several parameters can be assigned directly with the constructor of the class.
item Create applications, defining for each of them the data radio bearer type (GBR or non-GBR), IP classifier parameters, the start time, the stop time, and QoS parameters.
item Define the duration of the simulation and, finally, call the emph{Simulator::Run()} function.
end{itemize}
color{blue}
egin{lstlisting}
#include "../channel/LteChannel.h"
#include "../core/spectrum/bandwidth-manager.h"
#include "../networkTopology/Cell.h"
#include "../core/eventScheduler/simulator.h"
#include "../flows/application/InfiniteBuffer.h"
#include "../flows/QoS/QoSParameters.h"
#include "../componentManagers/FrameManager.h"
#include "../componentManagers/FlowsManager.h"
static void SimpleScenario ()
{
}
end{lstlisting}
color{black}
From this point, all instructions must be inserted into the "{}" of the previous declarated static function.
Create four basic LTE-Sim components (the emph{NetworkManager}, the emph{FramekManager}, the emph{FlowManager}, and the emph{Simulator}).
color{blue}
egin{lstlisting}
Simulator *simulator = Simulator::Init();
FrameManager *frameManager = FrameManager::Init();
NetworkManager* networkManager = NetworkManager::Init();
FlowsManager* flowsManager = FlowsManager::Init ();
end{lstlisting}
color{black}
Create Channels and Spectrum
color{blue}
egin{lstlisting}
LteChannel *dlCh = new LteChannel ();
LteChannel *ulCh = new LteChannel ();
BandwidthManager* spectrum = new BandwidthManager (5, 5, 0, 0);
end{lstlisting}
color{black}
Create an LTE cell.
color{blue}
egin{lstlisting}
// CREATE CELL
int idCell = 0;
int radius = 1; //km
int minDistance = 0.0035; //km
int posX = 0;
int posY = 0;
Cell* cell = networkManager->CreateCell (
idCell, radius, minDistance, posX, posY);
end{lstlisting}
color{black}
Create network elements (eNB, GW, and UE).
color{blue}
egin{lstlisting}
//Create ENodeB
int idEnb = 1;
ENodeB* enb = networkManager->CreateEnodeb (
idEnb, cell, posX, posY, dlCh, ulCh, spectrum);
enb->SetDLScheduler (ENodeB::DLScheduler_TYPE_PROPORTIONAL_FAIR);
//Create GW
Gateway *gw = networkManager->CreateGateway ();
//Create UE
int idUe = 2;
int posX_ue = 40; //m
int posY_ue = 0; //m
int speed = 3; //km/h
double speeDirection = 0;
UserEquipment* ue = networkManager->CreateUserEquipment (
idUe, posX_ue, posY_ue, speed, speeDirection, cell, enb);
end{lstlisting}
color{black}
Create an Infinete Buffer Application
color{blue}
egin{lstlisting}
//Create an Application
QoSParameters *qos = new QoSParameters ();
int applicationID = 0;
int srcPort = 0;
int dstPort = 100;
int stratTime = 10; //s
int stopTime = 30; //s
Application* be = flowsManager->CreateApplication (
applicationID,
gw, ue,
srcPort, dstPort, TransportProtocol::TRANSPORT_PROTOCOL_TYPE_UDP ,
Application::APPLICATION_TYPE_INFINITE_BUFFER,
qos,
stratTime, stopTime);
end{lstlisting}
color{black}
Define the duration of the simulation.
color{blue}
egin{lstlisting}
simulator->SetStop(60);
end{lstlisting}
color{black}
Call the emph{Simulator::Run()} function to strat the simulation.
color{blue}
egin{lstlisting}
simulator->Run ();
end{lstlisting}
color{black}
Finally, a reference of SimpleScenario() should be added into the main program. To this aim, insert into the LTE-Sim.cpp main program the folowing code:
color{blue}
egin{lstlisting}
#include "Simulations/SCENARIOS/SimpleScenario.h"
int
main (int argc, char *argv[])
{
...
if(strcmp(argv[1], "SimpleScenario")==0)
{
SimpleScenario();
}
}
end{lstlisting}
color{black}
end{document}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.