Class: PipelineSim::PipelineRegister
- Inherits:
-
Object
- Object
- PipelineSim::PipelineRegister
- Defined in:
- pipeline_simulation.rb
Overview
This is the class that creates the simulated pipeline registers
Initialization:
@IfIdRegister = PipelineRegister.new("IF/ID Register", {instruction: "0x00000000"})
After initialization, both @read and @write can be updated, but not @title
Definition of parameters:
title: string, name of register
read: hash, contents of the read side
write: hash, contents of the write side
Instance Attribute Summary collapse
-
#read ⇒ Hash
Returns the content of the read side of the register.
-
#title ⇒ String
readonly
Returns the title of the register.
-
#write ⇒ Hash
Returns the content of the write side of the register.
Instance Method Summary collapse
-
#initialize(title, hash) ⇒ PipelineRegister
constructor
Initializes new pipeline register object.
Constructor Details
#initialize(title, hash) ⇒ PipelineRegister
Initializes new pipeline register object
456 457 458 459 460 |
# File 'pipeline_simulation.rb', line 456 def initialize(title, hash) @title = title @read = hash @write = hash end |
Instance Attribute Details
#read ⇒ Hash
Returns the content of the read side of the register
448 449 450 |
# File 'pipeline_simulation.rb', line 448 def read @read end |
#title ⇒ String (readonly)
Returns the title of the register
445 446 447 |
# File 'pipeline_simulation.rb', line 445 def title @title end |
#write ⇒ Hash
Returns the content of the write side of the register
451 452 453 |
# File 'pipeline_simulation.rb', line 451 def write @write end |