Class: Idl::CsrSoftwareWriteAst
- Includes:
- Executable
- Defined in:
- lib/idl/ast.rb
Instance Method Summary collapse
- #csr ⇒ Object
- #csr_known?(symtab) ⇒ Boolean
- #csr_name(symtab) ⇒ Object
-
#execute(_symtab) ⇒ void
“execute” the statement by updating the variables in the symbol table.
-
#execute_unknown(_symtab) ⇒ Object
nothing to do for a function call.
- #expression ⇒ Object
-
#initialize(input, interval, csr, expression) ⇒ CsrSoftwareWriteAst
constructor
A new instance of CsrSoftwareWriteAst.
-
#to_idl ⇒ String
Return valid IDL representation of the node (and its subtree).
- #type_check(symtab) ⇒ Object
-
#value(_symtab) ⇒ Object
Return the compile-time-known value of the node.
Constructor Details
#initialize(input, interval, csr, expression) ⇒ CsrSoftwareWriteAst
Returns a new instance of CsrSoftwareWriteAst.
5950 5951 5952 |
# File 'lib/idl/ast.rb', line 5950 def initialize(input, interval, csr, expression) super(input, interval, [csr, expression]) end |
Instance Method Details
#csr ⇒ Object
5947 |
# File 'lib/idl/ast.rb', line 5947 def csr = @children[0] |
#csr_known?(symtab) ⇒ Boolean
5965 5966 5967 |
# File 'lib/idl/ast.rb', line 5965 def csr_known?(symtab) csr.csr_known?(symtab) end |
#csr_name(symtab) ⇒ Object
5969 5970 5971 |
# File 'lib/idl/ast.rb', line 5969 def csr_name(symtab) csr.csr_name(symtab) end |
#execute(_symtab) ⇒ void
This method returns an undefined value.
“execute” the statement by updating the variables in the symbol table
5979 |
# File 'lib/idl/ast.rb', line 5979 def execute(_symtab) = value_error "CSR writes are global" |
#execute_unknown(_symtab) ⇒ Object
nothing to do for a function call
5982 |
# File 'lib/idl/ast.rb', line 5982 def execute_unknown(_symtab); end |
#expression ⇒ Object
5948 |
# File 'lib/idl/ast.rb', line 5948 def expression = @children[1] |
#to_idl ⇒ String
Return valid IDL representation of the node (and its subtree)
5985 |
# File 'lib/idl/ast.rb', line 5985 def to_idl = "#{csr.to_idl}.sw_write(#{expression.to_idl})" |
#type_check(symtab) ⇒ Object
5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 |
# File 'lib/idl/ast.rb', line 5954 def type_check(symtab) archdef = symtab.archdef csr.type_check(symtab) expression.type_check(symtab) return if expression.type(symtab).kind == :bits && expression.type(symtab).width == symtab.mxlen type_error "CSR value must be an XReg" end |
#value(_symtab) ⇒ Object
Return the compile-time-known value of the node
5974 5975 5976 |
# File 'lib/idl/ast.rb', line 5974 def value(_symtab) value_error "CSR writes are global" end |