SlideShare una empresa de Scribd logo
1 de 4
--------------------------------------------------------------------------<br />-- Download and save file as mem_tb.vhd<br />-- AUB<br />-- EECE 321 - Computer Organization, Spring 2009<br />-- Author: M. M.<br />--------------------------------------------------------------------------<br />-- Description: Testbench for memory simulator<br />--------------------------------------------------------------------------<br />library ieee;<br />use ieee.std_logic_1164.all;<br />use ieee.std_logic_unsigned.all;<br />use ieee.std_logic_arith.all;<br />use ieee.std_logic_misc.all;<br />USE ieee.std_logic_textio.all;<br />USE std.textio.all;<br />LIBRARYwork;<br />USE work.auxiliary.all;<br />-- Dummy entity<br />ENTITY mem_tb is<br />END mem_tb;<br />-- Memory simulator architecture<br />ARCHITECTURE mem_tb of mem_tb is <br />-- input and output file name<br />CONSTANT in_fname  : STRING := quot;
..oem_input_file.txtquot;
;<br />CONSTANT out_fname : STRING := quot;
..oem_image_file.txtquot;
;<br />BEGIN<br />mem_behavior: process is<br />VARIABLE mem : MEM_ARRAY(0 to 63);<br />VARIABLE  word  : MIPS_WORD;<br />VARIABLE  data  : INTEGER;<br />BEGIN<br />-- initialize memory<br />init_mem(in_fname, mem);<br />-- load memory contents and print them<br />for i in mem'range loop<br />word := load_word(mem,4*i); -- note byte address<br />report quot;
word at byte address quot;
 & integer'image(i) & quot;
 = quot;
 & integer'image(conv_integer(word));<br />end loop;<br />-- perform some store operations<br />data := 16#22#;<br />word := conv_std_logic_vector(data,word'length); -- convert data into a 32-bit vector<br />store_word(mem,word,16#4#);<br />data := 16#33#;<br />word := conv_std_logic_vector(data,word'length); -- convert data into a 32-bit vector<br />store_word(mem,word,16#C#);<br />data := 16#44#;<br />word := conv_std_logic_vector(data,word'length); -- convert data into a 32-bit vector<br />store_word(mem,word,16#14#);<br />-- print new memory contents onto console<br />for i in mem'range loop<br />word := load_word(mem,4*i); -- note byte address<br />report quot;
word at byte address quot;
 & integer'image(i) & quot;
 = quot;
 & integer'image(conv_integer(word));<br />end loop;<br />-- copy contents of memory into an external file<br />copy_mem_2_file(out_fname, mem);<br />-- perform other memory functions<br />wait;<br />END process mem_behavior;<br />END mem_tb;<br />
Mem Tb
Mem Tb
Mem Tb

Más contenido relacionado

Similar a Mem Tb

第5回CCMSハンズオン(ソフトウェア講習会): AkaiKKRチュートリアル 2. AkaiKKRの実習
第5回CCMSハンズオン(ソフトウェア講習会): AkaiKKRチュートリアル 2. AkaiKKRの実習第5回CCMSハンズオン(ソフトウェア講習会): AkaiKKRチュートリアル 2. AkaiKKRの実習
第5回CCMSハンズオン(ソフトウェア講習会): AkaiKKRチュートリアル 2. AkaiKKRの実習Computational Materials Science Initiative
 
SiteGround Tech TeamBuilding
SiteGround Tech TeamBuildingSiteGround Tech TeamBuilding
SiteGround Tech TeamBuildingMarian Marinov
 
Manual & guide for birt eclipse report designer
Manual & guide for birt eclipse report designerManual & guide for birt eclipse report designer
Manual & guide for birt eclipse report designerAASIM MAHMOOD
 
Manual & guide_for_birt_eclipse_report designer
Manual & guide_for_birt_eclipse_report designerManual & guide_for_birt_eclipse_report designer
Manual & guide_for_birt_eclipse_report designerAASIM MAHMOOD
 
Privacy Policy - Color Wallpapers (Solid)
Privacy Policy - Color Wallpapers (Solid)Privacy Policy - Color Wallpapers (Solid)
Privacy Policy - Color Wallpapers (Solid)Ali J
 
Precision Bearing House, Industrial Automation | PBH
Precision Bearing House, Industrial Automation | PBHPrecision Bearing House, Industrial Automation | PBH
Precision Bearing House, Industrial Automation | PBHPrecision Bearing House
 
Thomas+Niewel+ +Oracletuning
Thomas+Niewel+ +OracletuningThomas+Niewel+ +Oracletuning
Thomas+Niewel+ +Oracletuningafa reg
 
Cs501 handouts 1_45-ilovepdf-compressed
Cs501 handouts 1_45-ilovepdf-compressedCs501 handouts 1_45-ilovepdf-compressed
Cs501 handouts 1_45-ilovepdf-compressedZahid Manzoor
 
Armboot process zeelogic
Armboot process zeelogicArmboot process zeelogic
Armboot process zeelogicAleem Shariff
 
Data Storage
Data StorageData Storage
Data Storageadil raja
 
Sweet fx readme
Sweet fx readmeSweet fx readme
Sweet fx readmeMLGGS
 

Similar a Mem Tb (20)

Ass hđh
Ass hđhAss hđh
Ass hđh
 
Quick reference for solr
Quick reference for solrQuick reference for solr
Quick reference for solr
 
第5回CCMSハンズオン(ソフトウェア講習会): AkaiKKRチュートリアル 2. AkaiKKRの実習
第5回CCMSハンズオン(ソフトウェア講習会): AkaiKKRチュートリアル 2. AkaiKKRの実習第5回CCMSハンズオン(ソフトウェア講習会): AkaiKKRチュートリアル 2. AkaiKKRの実習
第5回CCMSハンズオン(ソフトウェア講習会): AkaiKKRチュートリアル 2. AkaiKKRの実習
 
SiteGround Tech TeamBuilding
SiteGround Tech TeamBuildingSiteGround Tech TeamBuilding
SiteGround Tech TeamBuilding
 
Final Report
Final ReportFinal Report
Final Report
 
Manual & guide for birt eclipse report designer
Manual & guide for birt eclipse report designerManual & guide for birt eclipse report designer
Manual & guide for birt eclipse report designer
 
Manual & guide_for_birt_eclipse_report designer
Manual & guide_for_birt_eclipse_report designerManual & guide_for_birt_eclipse_report designer
Manual & guide_for_birt_eclipse_report designer
 
Pm800 userguide
Pm800 userguidePm800 userguide
Pm800 userguide
 
Privacy Policy - Color Wallpapers (Solid)
Privacy Policy - Color Wallpapers (Solid)Privacy Policy - Color Wallpapers (Solid)
Privacy Policy - Color Wallpapers (Solid)
 
Precision Bearing House, Industrial Automation | PBH
Precision Bearing House, Industrial Automation | PBHPrecision Bearing House, Industrial Automation | PBH
Precision Bearing House, Industrial Automation | PBH
 
MS-07 Jan June 2017
MS-07 Jan June 2017MS-07 Jan June 2017
MS-07 Jan June 2017
 
Using AWR/Statspack for Wait Analysis
Using AWR/Statspack for Wait AnalysisUsing AWR/Statspack for Wait Analysis
Using AWR/Statspack for Wait Analysis
 
Thomas+Niewel+ +Oracletuning
Thomas+Niewel+ +OracletuningThomas+Niewel+ +Oracletuning
Thomas+Niewel+ +Oracletuning
 
BeagleBone Black Bootloaders
BeagleBone Black BootloadersBeagleBone Black Bootloaders
BeagleBone Black Bootloaders
 
aaaaHistory
aaaaHistoryaaaaHistory
aaaaHistory
 
Cs501 handouts 1_45-ilovepdf-compressed
Cs501 handouts 1_45-ilovepdf-compressedCs501 handouts 1_45-ilovepdf-compressed
Cs501 handouts 1_45-ilovepdf-compressed
 
Version 1.7
Version 1.7Version 1.7
Version 1.7
 
Armboot process zeelogic
Armboot process zeelogicArmboot process zeelogic
Armboot process zeelogic
 
Data Storage
Data StorageData Storage
Data Storage
 
Sweet fx readme
Sweet fx readmeSweet fx readme
Sweet fx readme
 

Más de ececourse

Machine Problem 2
Machine Problem 2Machine Problem 2
Machine Problem 2ececourse
 
Machine Problem 1
Machine Problem 1Machine Problem 1
Machine Problem 1ececourse
 
Chapter 2 Hw
Chapter 2 HwChapter 2 Hw
Chapter 2 Hwececourse
 
Chapter 2 Part2 C
Chapter 2 Part2 CChapter 2 Part2 C
Chapter 2 Part2 Cececourse
 
C:\Fakepath\Chapter 2 Part2 B
C:\Fakepath\Chapter 2 Part2 BC:\Fakepath\Chapter 2 Part2 B
C:\Fakepath\Chapter 2 Part2 Bececourse
 
Chapter 2 Part2 A
Chapter 2 Part2 AChapter 2 Part2 A
Chapter 2 Part2 Aececourse
 
Chapter 2 Part1
Chapter 2 Part1Chapter 2 Part1
Chapter 2 Part1ececourse
 

Más de ececourse (14)

Chapter 5 c
Chapter 5 cChapter 5 c
Chapter 5 c
 
Chapter 5 b
Chapter 5  bChapter 5  b
Chapter 5 b
 
Chapter 5 a
Chapter 5 aChapter 5 a
Chapter 5 a
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
 
Chapter 3
Chapter 3Chapter 3
Chapter 3
 
Auxiliary
AuxiliaryAuxiliary
Auxiliary
 
Machine Problem 2
Machine Problem 2Machine Problem 2
Machine Problem 2
 
Machine Problem 1
Machine Problem 1Machine Problem 1
Machine Problem 1
 
Chapter 2 Hw
Chapter 2 HwChapter 2 Hw
Chapter 2 Hw
 
Chapter 2 Part2 C
Chapter 2 Part2 CChapter 2 Part2 C
Chapter 2 Part2 C
 
C:\Fakepath\Chapter 2 Part2 B
C:\Fakepath\Chapter 2 Part2 BC:\Fakepath\Chapter 2 Part2 B
C:\Fakepath\Chapter 2 Part2 B
 
Chapter 2 Part2 A
Chapter 2 Part2 AChapter 2 Part2 A
Chapter 2 Part2 A
 
Chapter1
Chapter1Chapter1
Chapter1
 
Chapter 2 Part1
Chapter 2 Part1Chapter 2 Part1
Chapter 2 Part1
 

Último

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 

Último (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

Mem Tb

  • 1. --------------------------------------------------------------------------<br />-- Download and save file as mem_tb.vhd<br />-- AUB<br />-- EECE 321 - Computer Organization, Spring 2009<br />-- Author: M. M.<br />--------------------------------------------------------------------------<br />-- Description: Testbench for memory simulator<br />--------------------------------------------------------------------------<br />library ieee;<br />use ieee.std_logic_1164.all;<br />use ieee.std_logic_unsigned.all;<br />use ieee.std_logic_arith.all;<br />use ieee.std_logic_misc.all;<br />USE ieee.std_logic_textio.all;<br />USE std.textio.all;<br />LIBRARYwork;<br />USE work.auxiliary.all;<br />-- Dummy entity<br />ENTITY mem_tb is<br />END mem_tb;<br />-- Memory simulator architecture<br />ARCHITECTURE mem_tb of mem_tb is <br />-- input and output file name<br />CONSTANT in_fname : STRING := quot; ..oem_input_file.txtquot; ;<br />CONSTANT out_fname : STRING := quot; ..oem_image_file.txtquot; ;<br />BEGIN<br />mem_behavior: process is<br />VARIABLE mem : MEM_ARRAY(0 to 63);<br />VARIABLE word : MIPS_WORD;<br />VARIABLE data : INTEGER;<br />BEGIN<br />-- initialize memory<br />init_mem(in_fname, mem);<br />-- load memory contents and print them<br />for i in mem'range loop<br />word := load_word(mem,4*i); -- note byte address<br />report quot; word at byte address quot; & integer'image(i) & quot; = quot; & integer'image(conv_integer(word));<br />end loop;<br />-- perform some store operations<br />data := 16#22#;<br />word := conv_std_logic_vector(data,word'length); -- convert data into a 32-bit vector<br />store_word(mem,word,16#4#);<br />data := 16#33#;<br />word := conv_std_logic_vector(data,word'length); -- convert data into a 32-bit vector<br />store_word(mem,word,16#C#);<br />data := 16#44#;<br />word := conv_std_logic_vector(data,word'length); -- convert data into a 32-bit vector<br />store_word(mem,word,16#14#);<br />-- print new memory contents onto console<br />for i in mem'range loop<br />word := load_word(mem,4*i); -- note byte address<br />report quot; word at byte address quot; & integer'image(i) & quot; = quot; & integer'image(conv_integer(word));<br />end loop;<br />-- copy contents of memory into an external file<br />copy_mem_2_file(out_fname, mem);<br />-- perform other memory functions<br />wait;<br />END process mem_behavior;<br />END mem_tb;<br />