@@ -512,7 +512,7 @@ def pruned_sw_read_ast(arch_def)
512512 # @param exclude_unimplemented [Boolean] If true, do not create include unimplemented fields in the figure
513513 # @param optional_type [Integer] Wavedrom type (Fill color) for fields that are optional (not mandatory) in a partially-specified arch_def
514514 # @return [Hash] A representation of the WaveDrom drawing for the CSR (should be turned into JSON for wavedrom)
515- def wavedrom_desc ( arch_def , effective_xlen , exclude_unimplemented : false , optional_type : 3 )
515+ def wavedrom_desc ( arch_def , effective_xlen , exclude_unimplemented : false , optional_type : 2 )
516516 desc = {
517517 "reg" => [ ]
518518 }
@@ -536,9 +536,10 @@ def wavedrom_desc(arch_def, effective_xlen, exclude_unimplemented: false, option
536536 desc [ "reg" ] << { "bits" => n , type : 1 }
537537 end
538538 if arch_def . partially_configured? && field . optional_in_cfg? ( arch_def )
539- puts "#{ name } .#{ field . name } is OPTIONAL"
539+ puts "#{ name } .#{ field . name } is OPTIONAL #{ optional_type } "
540540 desc [ "reg" ] << { "bits" => field . location ( arch_def , effective_xlen ) . size , "name" => field . name , type : optional_type }
541541 else
542+ puts "#{ name } .#{ field . name } is NOT OPTIONAL 3"
542543 desc [ "reg" ] << { "bits" => field . location ( arch_def , effective_xlen ) . size , "name" => field . name , type : 3 }
543544 end
544545 last_idx = field . location ( arch_def , effective_xlen ) . max
@@ -572,7 +573,9 @@ def optional_in_cfg?(arch_def)
572573
573574 exists_in_cfg? ( arch_def ) &&
574575 arch_def . mandatory_extensions . all? do |ext_req |
575- ext_req . satisfying_versions ( arch_def ) . none? { |ext_ver | defined_by? ( ext_ver ) }
576+ ext_req . satisfying_versions ( arch_def ) . none? do |ext_ver |
577+ defined_by? ( ext_ver )
578+ end
576579 end
577580 end
578581end
0 commit comments