Class: HDLRuby::High::Std::PipelineT::PipeSignal
- Inherits:
-
Object
- Object
- HDLRuby::High::Std::PipelineT::PipeSignal
- Includes:
- HExpression
- Defined in:
- lib/HDLRuby/std/pipeline.rb
Overview
The pipeline signal generator class
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
The name of the signal to generate.
-
#signal ⇒ Object
readonly
The generated signal.
-
#type ⇒ Object
readonly
The type of the signal to generate.
Attributes included from HExpression
Instance Method Summary collapse
-
#<=(expr) ⇒ Object
Assigns +expr+ to the signal.
-
#initialize(name, scope) ⇒ PipeSignal
constructor
Create a new pipeline signal generator with +name+ whose resulting signal is to be added to +scope+.
-
#to_expr ⇒ Object
Converts to an expression.
-
#to_ref ⇒ Object
Converts to a reference.
Methods included from HExpression
#[], #as, #coerce, #constant?, #mux, orig_operator, #orig_operator, #to_value, #to_value?
Constructor Details
#initialize(name, scope) ⇒ PipeSignal
Create a new pipeline signal generator with +name+ whose resulting signal is to be added to +scope+.
30 31 32 33 34 35 |
# File 'lib/HDLRuby/std/pipeline.rb', line 30 def initialize(name,scope) @name = name.to_sym @scope = scope @type = nil @signal = nil end |
Instance Attribute Details
#name ⇒ Object (readonly)
The name of the signal to generate
24 25 26 |
# File 'lib/HDLRuby/std/pipeline.rb', line 24 def name @name end |
#signal ⇒ Object (readonly)
The generated signal
26 27 28 |
# File 'lib/HDLRuby/std/pipeline.rb', line 26 def signal @signal end |
#type ⇒ Object (readonly)
The type of the signal to generate
25 26 27 |
# File 'lib/HDLRuby/std/pipeline.rb', line 25 def type @type end |
Instance Method Details
#<=(expr) ⇒ Object
Assigns +expr+ to the signal. Is the signal is not generated yet, generate it.
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/HDLRuby/std/pipeline.rb', line 39 def <=(expr) # Ensures expr is an expression expr = expr.to_expr # Generate the signal if not existant # puts "@scope=#{@scope}" puts "For @name=#{@name} @signal=#{@signal}" @signal = @scope.make_inners(expr.type,@name) unless @signal # Performs the assignment. @signal <= expr end |
#to_expr ⇒ Object
Converts to an expression.
51 52 53 |
# File 'lib/HDLRuby/std/pipeline.rb', line 51 def to_expr return @signal.to_expr end |
#to_ref ⇒ Object
Converts to a reference.
56 57 58 |
# File 'lib/HDLRuby/std/pipeline.rb', line 56 def to_ref return @signal.to_ref end |