You are on page 1of 10

MNEME: A Memory

Hierarchy Simulator for an


Engineering Computer
Architecture Course
LORENZO MORENO, EVELIO J. GONZÁLEZ, BEATRICE POPESCU, JONAY TOLEDO,
JESÚS TORRES, CARINA GONZALEZ
Departamento de Ingenierı´a de Sistemas y Automática y ATC, University of La Laguna, CP 38207 Canary Islands, Spain

Received 9 June 2008; accepted 2 December 2008

ABSTRACT: As in other fields of Engineering, simulators are widely used to teach


Memory hierarchy topics. In this paper, a simulator called MNEME (due to the muse of the
memory in Greek mythology), which includes a complete vision of memory hierarchy topics, is
presented. This simulator has been validated and improved using feedback from students
during two academic years. This way, the students have taken part significantly in the MNEME
design process. ß 2009 Wiley Periodicals, Inc. Comput Appl Eng Educ; Published online in Wiley
InterScience (www.interscience.wiley.com); DOI 10.1002/cae.20317

Keywords: computer architecture; memory hierarchy; simulator

INTRODUCTION courses, simulators by themselves are not enough


to significantly improve the learning process. It is
Due to its importance, Memory hierarchy is taught in necessary to carry out other activities which allow
several subjects and degrees, with different level of the students to gain knowledge, comprehend theoreti-
depth and related to different topics. Apart from other cal concepts and apply those concepts to the real
resources (as reference books, like [1]), the use of world [2].
simulators is a tested valuable tool for the teaching of From their experience, the authors have observed
this discipline, since the students can test how cache three statements:
memory works with a detail that it is impossible to
reach by other techniques. Nevertheless, although *
There are many concepts defining themselves
simulators are widely used in Computer Architecture many parameters to establish in a practical
way: global/local memory, execution/wait
Correspondence to E. J. González (evelio@cyc.dfis.ull.es). queues, eviction algorithms, bus size between
ß 2009 Wiley Periodicals Inc. the different cache levels, cache memory size,

1
2 MORENO ET AL.

allocation page size, page size in virtual memory, testing the successive versions of the simulator, docu-
line size in cache memory, write allocate/non menting its use through tutorials and help files, detecting
write allocate, TLB size, mapping functions, etc. possible bugs, proposing new features/machines to be
*
Memory hierarchy teaching process should included, etc. These iterative activities will allow students
include every characteristic existing in actual to get a deeper knowledge of the subject in a social
machines: cache levels, page table implementa- constructivist way, since they are encouraged to share
tions, eviction algorithms, etc. their impressions and work together. In this way, several
*
It would be desirable, even more in a nearly principles identified by Chickering and Gamson [9] for
Design-based Research (DBR) approach, to good practice in undergraduate education are reached. It
make experiments on the hardware. Neverthe- is important to remark that the students have not written
less, due to technical limitations, experiments are any code for the simulator, since it is not the goal of the
often executed in a relatively old processor, with process. For these activities, Moodle platform has been
a simple cache organization, damaging the used as a collaboration framework among the students
learning process extensibility. In addition to this, and teachers.
concerning the other alternative, existing simu- This refinement process has been carried out for
lators, especially trace-driven oriented ones, are 2 years, obtaining a complete version of MNEME,
often too simple and show how caches work in detailed below. Nevertheless, the authors have
an isolated way. In contrast, execution-driven observed the benefits of this student participation
simulators are usually too complicated and and decided to repeat it as a learning procedure. For
without a friendly interface, becoming inappro- this purpose, the students will work in this phase with
priate for undergraduate students [3 5]. Regard- incomplete/old versions of the simulator and/or
ing to this, a survey of simulators can be found in including some novelties, such a new commercial
Ref. [6]. machine configuration.
This paper presents the mentioned simulator for
Keeping these statements in mind, the authors memory hierarchy topics in a Computer Architecture
have proposed a learning scheduling based on the course. The remainder of this paper is organized as
design and implementation of a simulator. This follows. Description of MNEME and Procedures for
simulator, called MNEME [7,8], reflects those state- Using it as a Learning Resource Section describes
ments and takes advantage from the flexibility of the MNEME features and its use as a learning resource.
software. Some complementary activities are related in Other
The debate about simple or complex simulators is Activities in the Course Section. The feedback of
out of the scope of this paper. Nevertheless, the students obtained in the validation phase is reported in
authors will state that a simulator should not carry out Evaluation and Feedback From the Students Section.
an excessive simplification in order to make it simple. Finally some conclusions are offered.
In other words, developers should not oversimplify
their design because doing this, they could lead to new
DESCRIPTION OF MNEME AND
misconceptions. In contrast, if the real context is
PROCEDURES FOR USING IT AS
complex itself (i.e., with many parameters and many
A LEARNING RESOURCE
concepts to be monitored for a pedagogical pursue),
the simulator needs to be complex. In this last case,
Description of the MNEME Simulator
implementers must include some kind of mechanism
in order to make the simulator useful from a MNEME is a multiplatform simulation tool developed
pedagogical point of view. Thus, MNEME will result in Java Swing as an Applet, so it can be run in any
in a complex simulator, and this is its main strength: Internet browser window. This fact does not mean that
its complexity will cover a wide and complete range the simulator can not be run locally, since MNEME can
of architectures and examples. be downloaded free of charge and the users can access
Although the simulator is valuable tool in and of its features by opening a HTML file, called sj.html.
itself (as example, when it is used in laboratory Due to the complexity of the field to model,
procedures), the proposed method has taken pedagogical MNEME results in a complex simulator. The main
aspects from the design phase. For this phase, researchers features of MNEME can be summarized as follows:
have been assumed the roles of teacher and observer of
the process. The students (from different degrees and multithread,
subjects) were asked to take part actively in this process, hyperpaging
looking for information in technical papers and journals, direct and reverse mapping,
MNEME 3

TLB with levels, defines diverse parameters concerning the main


age paging control, memory configuration. The name of the tags are
data loading from server, pretended to be auto-explained, thus students can
eviction policy definition, define their own configuration files. The complete
sizeable buses, information about the tags and their meaning is added
control of the simulation speed. in the simulator help.

Interaction with the simulator can be defined by Confirmation/Changes of MNEME Configuration.


the following sequence: Although configuration files are pretended to be an
easy way to define new memory hierarchy config-
Loading a Configuration File. The configuration file urations, users can modify the parameters they have
is a XML file determining the configuration structure just loaded from the simulator GUI (as shown in
of the simulator. As example, the following excerpt Fig. 1) without editing any XML file. There is no
limitation when defining cache size. Nevertheless,
MNEME defines a 2-digit limit for levels of memory
hierarchy and threads to be simulated.

Loading a Trace File. This file contains a set of read/


write/fetch instructions. An excerpt of an example is
the following:

Each line represents the address to be accessed and


the type of access. As can be seen, the address to be

Figure 1 An example of MNEME configuration tab.


4 MORENO ET AL.

accessed is expressed in hexadecimal format. This memory address. In Figure 2, the cells contain a 1
address, composed by 8 digits, is not shown directly in value. This configuration means that the system is in
the simulator. The address is divided into three its initial status, that is, no data have been loaded yet
fragments: the first 5 digits (20 bits), the next 2 digits in the different memory levels.
(8 bits) and the last digit (4 bits). The first fragment is In the heading of each memory level, it
translated to decimal format and assigned to the text can be observed a button with the information
field ‘‘VPN’’ in the pageTable tab. The other fragments symbol. When these buttons are pressed, a window
are assigned to the cache level fields in the findPages containing information about its corresponding con-
tab. The mentioned tabs are described below. figuration details are shown by the simulator, as in
Figure 3.
Simulation. Once the two files have been loaded, In the top of each table, the address being
simulation starts. MNEME offers a set of tabs where a accessed is shown (in both decimal and hexadecimal
complete list of parameters can be visualized by the format). In addition of this, the instruction being
students. Before describing each tab, it is important to processed is shown in the bottom left-hand corner and
remark that MNEME provides a color code that allows the user can chose the simulation control from four
the user to detect in an easy and visual way every effect buttons in the tab (play, stop, pause, and step) and a
on the code trace. For each event, the color of implied bar that defines the speed of the simulation.
code lines will change. Before an object is removed
(e.g., when a page is replaced in the main memory and PageTable Tab. In this tab, MNEME shows the
thus the page does not need to be referenced any more different memories that take part in the table pages. In
in the TLB) or replaced, there is a delay (about 2 s) that Figure 4, concerning to an indirect mapping, they can
allows the user to follow the changes properly. be observed the main memory TLB and the indirect
mapping table. In the case of a direct mapping, the
findPages Tab. In the findPages tab, MNEME offers simulator shows the tree of information tables for the
in a visual way, the actual status of the diverse mapping and the information concerning the virtual
memories of the configured machine. In Figure 2, they address.
can be observed three cache levels and the main
memory. Data are represented by tables, where each Bp Tab. This tab (shown in Fig. 5) includes
column is an attribute (number of inputs i, KEY, pid of information about the structure of the system. It also
the referred process, etc.) and each file represent a represents the actions to be carried out in each step.

Figure 2 MNEME findPages Tab.


MNEME 5

cQueue: Queue (Execution (E) or Wait (W)).


cQInd: position of the process Pid in the queue
pointed by cQueue.
Apart from the described tabs, the practical
experience is reinforced with contextual help easily
accessible from any part of the simulator (it is
important to remark that some of these help files
have been redacted by the students themselves). This
help includes a user guide for the simulator and a
quick review of the theoretical concepts that the
students may need.

Procedures for Using MNEME as a


Learning Resource
As stated above, MNEME simulator has been
Figure 3 An example of configuration details in
MNEME.
designed in order to be applied in several subjects. It
is clear that different subjects imply different level of
Proc Tab. In MNEME the number of threads to be depth and different focus. In this point, and as
loaded will be between 1 and 28. A thread can be in example, the authors will describe a typical sequence
two queues: Execution (E) and Wait (W). These of procedures based on the MNEME simulator
queues can be visualized once a trace file has been applied to the Operating systems subject. This subject
loaded into the simulator. is coursed in the second year in Computer Science
In table shown in Figure 6, the user can visualize degree. The proposed procedures are focused on
the following parameters: different paging algorithms to be used in an Operative
System, presenting their characteristics to the
Pid: Process identifier. students.
Instr: View the instructions of the program.
TU: Units of time of the process. Introduction to the MNEME Simulator. The first
Ni: Number of the following instruction to be procedure goal is that the student learns how to use the
executed by the process Pid. simulator. For this purpose, the students are presented
cTuLeft: Time left in the queue. a very simple case of pagination: a hierarchical

Figure 4 MNEME PageTable tab.


6 MORENO ET AL.

example has a high number of page faults, with a small


size memory, so the Operative System will send these
pages to disk frequently. Local and Global strategy will
be tested in order to show the simulator characteristics.

Advanced Paging Management. The last exercise is


based on advanced paging methods like reverse
mapped page table, page aging and the lineal virtual
memory page table. The simulator makes easy to the
student these advanced techniques. In this exercise,
the TLB will be tested too, testing the efficiency of the
system in relation to the TLB size. In this exercise,
all the MNEME characteristics will be shown, so
Figure 5 MNEME Bp Tab.
students will see the data go out to the memory, inside
the CPU Cache. The system is shown as a global
pagination system with two levels, and only one system, from the hardware to the operative system.
process accessing the memory. The students are very This exercise is focused on the operative system
familiar to this case, since they have studied it in paging management, so MNEME will be configured
theoretical classes. In this way, students are expected using only these characteristics. Other features like
to pay more attention to MNEME features instead to multiple cache levels will be used in other subjects
the particular application case. Moreover, this case is like Computer Architecture. A simulator like
easy to follow and easy to predict. The code of the MNEME which is able to simulate a wide range of
application consists on a sequence of accesses to systems, is very useful in a Computer Science degree.
memory, including both cache misses and hits. Student will know the simulator and will test
After this first procedure, the students have learnt the computer structure with different points of
about the MNEME menus and options and to interpret view: hardware, Operative System and Computer
its tables and graphics. Moreover, the students are able Architecture.
to follow a trace of memory accesses from the process
code to the simulator GUI.
OTHER ACTIVITIES IN THE COURSE
Paging in a Multiprogramming System. In
the second practical procedure, MNEME is applied From their experience in other analogue subjects, the
to a multiprogramming paging system. Students authors extrapolate some reinforcement experiences
define the number of processes accessing to the memory hierarchy subject.
concurrently to memory, the quantum time of each
process and the structure of the page table. MNEME
Presentation on State of the Art of
manages a process scheduler which controls the
Computing Systems/Machines
process execution and will carry out the CPU if the
process makes a page fault or if the quantum time Each group of 2 3 students is assigned a machine in
finishes. order to study it from a memory hierarchy context and
design a 30 40 min Powerpoint-like presentation to
Memory Management System. In the third be shown in class. After the presentation, they carry
procedure, students learn about the MNEME memory out a discussion with other groups that have been
and process management characteristics, so different assigned similar architectures in order to compare
table page structures will be tested. A basic program their results. Thus, they contact with powerful ideas as
will be studied applying different techniques, in order objects to extrapolation and appropriation.
to test the efficiency of the algorithms. The code
Wiki of Memory Hierarchy Concepts About
State of the Art Machines
Each group produces a collaborative document
about concepts and characteristics of the analyzed
machines. This helps them to consolidate their
Figure 6 MNEME Proc tab (detail). learning by means of the transference and synthesis
MNEME 7

of the studied concepts. Moreover, students of ware evaluation, simulators use and programming
successive years will make use of these documents procedures) were asked to carry out a collaborative-
by correcting their weaknesses and profiting from type validation and to fill a questionnaire about
their valuable contents. MNEME and how the simulator helped them in the
subject. This questionnaire basically focused on three
main aspects:
Wiki Analysis
(1) The suitability of the simulator for the educa-
The teachers point out common points and differences
tional requirements of the students.
among the analyzed machines. Additionally they
(2) The features and functionality of the software.
mediate in several discussions about these topics. In
(3) The technical aspects of the simulator, such as
this way analysis, thoughts and learning about
malfunctions or bugs.
possible mistakes or misconceptions are achieved.
As result of the feedback process, some state-
ments can be reported
Final Evaluation
This mixed evaluation method includes observation, 100% of the students have tested MNEME for
automatic registration, interview, individual test, 3 6 h before answering the questionnaire.
teacher notebook, etc. The following methods are 90% of the students did not know if there was
used in this task: any similar software for memory hierarchy
simulation.
quantitative Methods (individual tests, auto- 90% of the students agree that MNEME helps to
matic registers in Moodle), understand the subject topics better.
qualitative Methods (observations, inter- 70% of the students believe that MNEME keeps
views), their interest.
social Networks (observation of face to face Nevertheless, students also confirm that it is
relations, interactions in Moodle). necessary to make some improvements in the
MNEME environment, since every interviewed
As can be observed from this methodological student pointed out that the architecture in
approach, the role of MNEME as learning mediator is MNEME is not easy to follow.
essential in order to improve an educational experi- 90% of the students points out that the help
ence that covers all memory hierarchy processor files are clear and concise. It is clear from
concepts. the fact of that students themselves took
part in the redaction of MNEME help files.
A similar percentage agrees that MNEME
EVALUATION AND FEEDBACK FROM is highly flexible in order to design new
THE STUDENTS procedures.
Concerning to the technical aspects of the
Feedback from students is a crucial piece of simulator, such as malfunctions or bugs, all of
information in order to verify the usefulness of the the students agree that MNEME works fine and
proposed exercises [9]. Some weaknesses and poten- it can be perfectly run in different operating
tial improvements of the simulator and the method- systems.
ology can also be identified in this way. As stated
above, a first approach to this feedback was carried Apart from these data from the questionnaires,
out in the design of the simulator, since a group of students and teachers held a meeting, discussing
students took part significantly in this design, cooperatively about how to improve the simulator. In
proposing some improvements that were included in this sense, students proposed several ideas, such as the
the final version of MNEME. These improvements design of a tutorial with an assistant that introduce
were especially focused on the usability of the users the features of the simulator.
simulator, due to the inherent complexity of the As a complement to the commented validation
system to model. tasks, the simulator was presented in a domestic
Apart from this first feedback phase, several educational conference [9] and more opinions and
students from a Computer Architecture course in suggestions were collected from several users that
Computer Science degree (with experience in soft- tested the simulator.
8 MORENO ET AL.

Finally, from the authors’ point of view, the use of are being added to the simulator. These features
MNEME helped the students to better understand the will allow making valuable statistics about the
memory hierarchy theoretical concepts. However, the utility of tool, for example, comparison of test scores
most remarkable results were related to the student- (on the same topic) with and without the use of
teacher interaction. The students showed a higher MNEME.
level of motivation, which was reflected in a
significant increase in class participation and general
interest in the subject.
REFERENCES

[1] J. L. Hennesy and D. A. Patterson, Computer


CONCLUSIONS AND FUTURE WORK architecture: A quantitative approach, 3rd edition,
San Mateo, CA, Morgan Kaufmann, 2003.
This paper has presented a memory hierarchy [2] L. Moreno, C. S. González, I. Castilla, E. J. González,
simulator (MNEME) in whose design students have and J. F. Sigut, Use of constructivism and collaborative
taken part significantly, code-based procedures using teaching in an ILP processors course, IEEE Trans Educ
that simulator and finally some complementary 2 (2007), 101 111.
activities such as presentation on state of the art of [3] A. Beg and W. Ibrahim, PerfPred: A web-based tool for
computing systems/machines, wiki of Memory hier- exploring computer architecture design space, Comput
Appl Eng Educ (2009), in press.
archy concepts, etc. The simulator is a valuable tool
[4] A. Beg, ‘‘Incorporating Program Characteristics into a
for teaching memory hierarchy that offers advantages
Processor Model’’, in International Conference on
that no other available simulators can provide. As Circuits & Systems (ICCS’08), San Francisco, CA,
memory hierarchy implies a huge set of concepts and 2008.
parameters, MNEME results in a complex but rich [5] J. Sahuquillo, N. Tomás, S. Petit, and A. Pont, Spim-
environment, where non-trivial configurations can be Cache: A pedagogical tool for teaching cache
tested. Thus, complexity in the simulator will improve memories through code-based exercises, IEEE Trans
the learning process. Educ 50 (2007), 244 250.
In addition to this, since the students have taken [6] W. Yurcik, G. S. Wolffe, and M. A. Holiday, A survey
part in MNEME design, they have shown a greater of simulators used in computer organization/architec-
motivation, difficult to find in these types of courses. ture courses, Proc. Summer Computer Simulation
Conf., Orlando, FL, 2001, pp 524 529.
Due to this motivation success, this methodology will
[7] MNEME can be downloaded fromhttp://www.isaatc.
also be applied to teaching other aspects of the course,
ull.es/portal/proyectos/mneme/descargas (Last access:
such as multiprocessing. 15th November, 2007).
The numerous tests which have been performed [8] L. Moreno, E. J. González, B. Popescu, J. Torres, J.
during the last 2 years have confirmed the utility of Toledo, and C. S. González, Simuladores de Jerarquı́a
MNEME as an educational tool to support teaching of de Memoria en el Contexto de un Proceso de
memory hierarchy. Investigación-Acción, XIII Jornadas de Enseñanza
Currently new features are being developed for Universitaria de la Informática, Teruel, Spain, July,
the simulator, including those related to usability. 2007.
These improvements include the design of an [9] A. W. Chickering and Z. F. Gamson, Applying
interactive tutorial about MNEME configuration and the seven principles for good practice in
undergraduate education, New directions for teaching
the implementation of a tool that will allow the
and learning, vol. 47, Jossey-Bass Inc., San Francisco,
professor to hide some features of the simulator
CA, 1991.
depending on the knowledge of the student. In other [10] L. Harvey, Student feedback: A report to the Higher
words, MNEME will become a highly reconfigurable Education Funding Council for England. Technical
simulator, loading the different configurations report. Available at: http://www.uce.ac.uk/crq/publica-
from a metadata file. Moreover, software modules tions/studentfeedback.pdf, October 2001 (last
about multicore processors and NUMA configuration accessed: 19/04/2006).
MNEME 9

BIOGRAPHIES

Lorenzo Moreno received his MS and PhD Jonay Toledo received his degree in Com-
degrees from the Universidad Complutense puter Science Engineering in 2001 and his
de Madrid, Spain, in 1973 and 1977, degree in Electronics Engineering in 2002
respectively. From 1977 to 1979 he was an from the University of La Laguna, Tenerife,
associate professor in the Department of Spain. From 2002 to 2008 he has been a
Computer and Control Engineering, Univer- Researcher at the Department of Systems
sidad del Paı́s Vasco, Spain. From 1979 to Engineering and Automation of the Univer-
1988 he was an associate professor in the sity of La Laguna, where he is currently an
Department of Computer Science, University associate professor. He received his PhD in
Autónoma de Barcelona, Spain. Since 1989 2008 from the University of La Laguna,
he is a full professor in the University of La Laguna, Tenerife, Spain. Tenerife, Spain. His two main research fields are robotics and
His areas of interest include computer architecture and computer control systems.
education.
Jesús Torres was born in S/C de Tenerife,
Evelio J. González received the MS degree Spain. He received his degree in Electronics
in Applied Physics in 1998 and his PhD Engineering in 2001 from the University of
degree in Computer Science in 2004 from the La Laguna, Tenerife Spain. From 2001 to
University of La Laguna, Tenerife, Spain. 2008 he has been a researcher at Department
From 1998 to 2001, he was a Research of Systems Engineering and Control and
Student in the Department of Applied Computer Architecture in the University of
Physics, Electronics and Systems at the same La Laguna, where he is currently an
university. Currently, he works as assistant associate professor. He worked in autono-
professor in the University of La Laguna. His mous robot heading and position localization
areas of interest include Simulation, Digital systems and in artificial hearing to develop sensorial substitution
Control, Computer Architecture, Artificial Intelligence and Intelli- devices for deaf. But currently his main research field is the
gent Agents. computer vision applied to pose and gesture recognition.

Beatrice Popescu was born in Targoviste, Carina Gonzalez got her PhD (Cum Laude)
Romania. She received her degree in Com- in computer science from the University of
puter Science in 2004 from the University of La Laguna (ULL), Spain, in 2001. Currently
Bucuresti, Romania. From 2004 to 2005 she she teaches in the Department of Systems
worked as a programmer at GZK Software, Engineering and Control and Computer
Bucuresti, Romania. Since 2006 she has a Architecture of ULL. Her main focus area
scholarship in the University of La Laguna, in research is the application of AI and
Spain. multimedia adaptive interfaces in education.
She is also director of the Center of Virtual
Learning at ULL, member of EDULAB
(Laboratory of Education and New Technologies) and member of
IEEE and of the Spanish Chapter of the IEEE Education Society,
Association of Human-Computer Interaction of Spain, and Distance
Education Net, among others.
10 MORENO ET AL.

You might also like