SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
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
 
[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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 

Kürzlich hochgeladen (20)

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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 
[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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

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 />