Class: PipelineSim::Regs
- Inherits:
-
Object
- Object
- PipelineSim::Regs
- Defined in:
- pipeline_simulation.rb
Overview
This is the class that creates the simulated registers
Initialization:
regs = Regs.new(size)
After initialization, @content is the only thing that can be changed
Definition of parameters:
size: integer, reflects the total size of register array
Instance Attribute Summary collapse
-
#content ⇒ Array
Returns the content of the register.
Instance Method Summary collapse
-
#initialize(size) ⇒ Regs
constructor
Initializes new Regs object.
-
#show ⇒ void
Prints out contents of the register.
Constructor Details
#initialize(size) ⇒ Regs
Note:
This function just creates dummy data in the registers. Currently it fills it with hexadecimal numbers.
Initializes new Regs object
411 412 413 |
# File 'pipeline_simulation.rb', line 411 def initialize(size) @content = initialize_content(size) end |
Instance Attribute Details
#content ⇒ Array
Returns the content of the register
405 406 407 |
# File 'pipeline_simulation.rb', line 405 def content @content end |
Instance Method Details
#show ⇒ void
This method returns an undefined value.
Prints out contents of the register
417 418 419 |
# File 'pipeline_simulation.rb', line 417 def show puts "Regs: " + @content.join(', ') end |