Skip to content

Commit 3113191

Browse files
author
Derek Hower
committed
Fix missing sw_write
1 parent 246b7c9 commit 3113191

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

backends/cpp_hart_gen/tasks.rake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ end
7575
# a config-specifc generated header
7676
rule %r{#{CPP_HART_GEN_DST}/.*/include/udb/cfgs/[^/]+/[^/]+\.hxx\.unformatted} => proc { |tname|
7777
parts = tname.split("/")
78-
filename = parts[-1]
78+
filename = parts[-1].sub(/\.unformatted$/, "")
7979
[
8080
"#{CPP_HART_GEN_SRC}/templates/#{filename}.erb",
8181
"#{CPP_HART_GEN_SRC}/lib/gen_cpp.rb",
@@ -85,7 +85,7 @@ rule %r{#{CPP_HART_GEN_DST}/.*/include/udb/cfgs/[^/]+/[^/]+\.hxx\.unformatted} =
8585
]
8686
} do |t|
8787
parts = t.name.split("/")
88-
filename = parts[-1]
88+
filename = parts[-1].sub(/\.unformatted$/, "")
8989
config_name = parts[-2]
9090

9191
cfg_arch = cfg_arch_for(config_name)
@@ -99,9 +99,9 @@ rule %r{#{CPP_HART_GEN_DST}/.*/include/udb/cfgs/[^/]+/[^/]+\.hxx\.unformatted} =
9999
end
100100

101101
rule %r{#{CPP_HART_GEN_DST}/.*/include/udb/cfgs/[^/]+/[^/]+\.hxx} => proc { |tname|
102-
[tname.rsub(".unformatted", "")]
102+
["#{tname}.unformatted"]
103103
} do |t|
104-
sh "clang-format #{t.name.rsub('.unformatted', '')} > #{t.name}"
104+
sh "clang-format #{t.name}.unformatted > #{t.name}"
105105
end
106106

107107
rule %r{#{CPP_HART_GEN_DST}/.*/src/cfgs/[^/]+/[^/]+\.cxx} => proc { |tname|
@@ -226,6 +226,7 @@ namespace :gen do
226226
end
227227

228228
Rake::Task["#{CPP_HART_GEN_DST}/#{build_name}/CMakeLists.txt"].invoke
229+
229230
Rake::Task["#{CPP_HART_GEN_DST}/#{build_name}/include/udb/hart_factory.hxx"].invoke
230231
Rake::Task["#{CPP_HART_GEN_DST}/#{build_name}/include/udb/db_data.hxx"].invoke
231232
Rake::Task["#{CPP_HART_GEN_DST}/#{build_name}/src/db_data.cxx"].invoke
@@ -250,7 +251,6 @@ namespace :gen do
250251
Rake::Task["#{CPP_HART_GEN_DST}/#{build_name}/include/udb/#{File.basename(f)}"].invoke
251252
end
252253

253-
#Rake::Task["#{CPP_HART_GEN_DST}/#{build_name}/build/Makefile"].invoke
254254
end
255255
end
256256
end

backends/cpp_hart_gen/templates/csrs.hxx.erb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,13 @@ namespace udb {
137137
}
138138
<%- end -%>
139139

140-
void sw_write(const uint64_t &field_write_value, const unsigned& xlen) override;
140+
void sw_write(const uint64_t &field_write_value, const unsigned& xlen) override {
141+
<%- if cfg_arch.multi_xlen? && field.dynamic_location? -%>
142+
return _sw_write(field_write_value, xlen);
143+
<%- else -%>
144+
return _sw_write(field_write_value);
145+
<%- end -%>
146+
}
141147
<%- if cfg_arch.multi_xlen? && field.dynamic_location? -%>
142148
void _sw_write(const ValueType &field_write_value, const unsigned& xlen);
143149
<%- else -%>

backends/cpp_hart_gen/templates/hart.hxx.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ namespace udb {
9090
// XRegister<MXLEN>& xregRef(unsigned num) { return m_xregs[num]; }
9191

9292
void set_xreg(unsigned num, uint64_t value) override {
93-
m_xregs[num] = value; // zero index check happens in XRegister class
93+
_set_xreg(num, value);
9494
}
9595

9696
template <typename IdxType, typename ValType>

0 commit comments

Comments
 (0)