Module: HDLRuby::High::BlockHierarchy
Overview
Module adding show_hierarchyto block objects.
Instance Method Summary collapse
-
#get_vars_with_fullname(vars_with_fullname = {}) ⇒ Object
Gets the VCD variables with their long name.
-
#show_hierarchy(vcdout) ⇒ Object
Shows the hierarchy of the variables.
Instance Method Details
#get_vars_with_fullname(vars_with_fullname = {}) ⇒ Object
Gets the VCD variables with their long name.
240 241 242 243 244 245 246 247 248 249 250 |
# File 'lib/HDLRuby/hruby_rsim_vcd.rb', line 240 def get_vars_with_fullname(vars_with_fullname = {}) # Adds the inner signals. self.each_inner do |sig| vars_with_fullname[sig] = HDLRuby::High.vcd_name(sig.fullname) end # Recurse on the statements. self.each_statement do |stmnt| stmnt.get_vars_with_fullname(vars_with_fullname) end return vars_with_fullname end |
#show_hierarchy(vcdout) ⇒ Object
Shows the hierarchy of the variables.
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
# File 'lib/HDLRuby/hruby_rsim_vcd.rb', line 214 def show_hierarchy(vcdout) # puts "show_hierarchy for block=#{self}" # Shows the current level of hierarchy if there is a name. ismodule = false unless self.name.empty? vcdout << "$scope module #{HDLRuby::High.vcd_name(self.name)} $end\n" ismodule = true end # Shows the inner signals. self.each_inner do |sig| # puts "showing inner signal #{HDLRuby::High.vcd_name(sig.fullname)}" vcdout << "$var wire #{sig.type.width} " vcdout << "#{HDLRuby::High.vcd_name(sig.fullname)} " vcdout << "#{HDLRuby::High.vcd_name(sig.name)} $end\n" end # Recurse on the statements self.each_statement do |stmnt| stmnt.show_hierarchy(vcdout) end # Close the current level of hierarchy if there is a name. if ismodule then vcdout << "$upscope $end\n" end end |