Class: HDLRuby::High::Code

Inherits:
Low::Code
  • Object
show all
Defined in:
lib/HDLRuby/hruby_high.rb,
lib/HDLRuby/hruby_rsim.rb,
lib/HDLRuby/hruby_rcsim.rb,
lib/HDLRuby/hruby_high_fullname.rb

Overview

Extends the Code class for hybrid Ruby-C simulation.

Constant Summary

Constants included from Low::Low2Symbol

Low::Low2Symbol::Low2SymbolPrefix, Low::Low2Symbol::Low2SymbolTable, Low::Low2Symbol::Symbol2LowTable

Instance Attribute Summary

Attributes included from Low::Hparent

#parent

Instance Method Summary collapse

Methods inherited from Low::Code

#add_chunk, #add_event, #c_code_allocate, #each_chunk, #each_deep, #each_event, #eql?, #has_event?, #hash, #initialize, #on_edge?, #set_content!, #set_type!, #to_c, #to_ch, #to_file, #to_hdr, #to_high, #to_vhdl

Methods included from Low::Low2Symbol

#to_sym

Methods included from Low::Hparent

#hierarchy, #no_parent!, #scope

Constructor Details

This class inherits a constructor from HDLRuby::Low::Code

Instance Method Details

#to_lowObject

Converts the if to HDLRuby::Low.



2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
# File 'lib/HDLRuby/hruby_high.rb', line 2445

def to_low
    # Create the resulting code.
    codeL = HDLRuby::Low::Code.new
    # # For debugging: set the source high object 
    # codeL.properties[:low2high] = self.hdr_id
    # self.properties[:high2low] = codeL
    # Add the low-level events.
    self.each_event { |event| codeL.add_event(event.to_low) }
    # Add the low-level code chunks.
    self.each_chunk { |chunk| codeL.add_chunk(chunk.to_low) }
    # Return the resulting code.
    return codeL
end