Class: CacheSim::MainMemory
- Inherits:
-
Object
- Object
- CacheSim::MainMemory
- Defined in:
- cache_simulation.rb
Overview
This is the class that creates the simulated main memory
Initialization:
main_memory = CacheSim::MainMemory.new(size)
After initialization, @content is the only thing that can be changed
Instance Attribute Summary collapse
-
#content ⇒ Array
Returns the content of the cache.
Instance Method Summary collapse
-
#initialize(size) ⇒ MainMemory
constructor
Initializes new MainMemory object.
Constructor Details
#initialize(size) ⇒ MainMemory
Note:
This function just creates dummy data in the cache. Currently it fills it with hexadecimal numbers.
Initializes new MainMemory object
293 294 295 296 |
# File 'cache_simulation.rb', line 293 def initialize(size) @size = size @content = initialize_content end |
Instance Attribute Details
#content ⇒ Array
Returns the content of the cache
287 288 289 |
# File 'cache_simulation.rb', line 287 def content @content end |