Skip to content

Commit 47fff49

Browse files
Merge branch 'big-beautiful-refactoring' of https://github.com/riscv-software-src/riscv-unified-db into big-beautiful-refactoring
2 parents 0674ef7 + 70c1d79 commit 47fff49

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

.vscode/launch.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@
1919
"args": [],
2020
"askParameters": false
2121
},
22+
{
23+
"type": "rdbg",
24+
"name": "portfolios",
25+
"request": "launch",
26+
"command": "bundle exec rake",
27+
"script": "portfolios",
28+
"args": [],
29+
"askParameters": false
30+
},
2231
{
2332
"type": "rdbg",
2433
"name": "RVA20",

lib/arch_obj_models/csr_field.rb

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def initialize(parent_csr, field_name, field_data)
2525
super(field_data, parent_csr.data_path, parent_csr.arch)
2626
@name = field_name
2727
@parent = parent_csr
28+
@type_cache = {}
2829
end
2930

3031
# @param possible_xlens [Array<Integer>] List of xlens that be used in any implemented mode
@@ -159,13 +160,7 @@ def pruned_type_ast(symtab)
159160
def type(symtab)
160161
raise ArgumentError, "Argument 1 should be a symtab" unless symtab.is_a?(Idl::SymbolTable)
161162

162-
unless @type_cache.nil?
163-
unless @type_cache.key?(symtab.design)
164-
raise "Different design for type #{@type_cache.keys}, #{symtab.design}"
165-
end
166-
167-
return @type_cache[symtab.design]
168-
end
163+
return @type_cache[symtab.design] if @type_cache.key?(symtab.design)
169164

170165
type =
171166
if @data.key?("type")
@@ -210,7 +205,6 @@ def type(symtab)
210205
# end
211206
end
212207

213-
@type_cache ||= {}
214208
@type_cache[symtab.design] = type
215209
end
216210

0 commit comments

Comments
 (0)