Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc: many fixes to cospike #1450

Merged
merged 3 commits into from
Apr 20, 2023
Merged

Conversation

tianrui-wei
Copy link
Member

Related PRs / Issues:

Type of change:

  • Bug fix
  • New feature
  • Other enhancement

Impact:

  • RTL change
  • Software change (RISC-V software)
  • Build system change
  • Other

Contributor Checklist:

  • Did you set main as the base branch?
  • Is this PR's title suitable for inclusion in the changelog and have you added a changelog:<topic> label?
  • Did you state the type-of-change/impact?
  • Did you delete any extraneous prints/debugging code?
  • Did you mark the PR with a changelog: label?
  • (If applicable) Did you update the conda .conda-lock.yml file if you updated the conda requirements file?
  • (If applicable) Did you add documentation for the feature?
  • (If applicable) Did you add a test demonstrating the PR?
  • (If applicable) Did you mark the PR as Please Backport?

Signed-off-by: Tianrui Wei <tianrui@tianruiwei.com>
@@ -87,7 +94,7 @@ extern "C" void cospike_cosim(long long int cycle,
nullptr,
info->isa.c_str(),
"MSU",
"vlen:128,elen:64",
"vlen:512,elen:64",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this for now, we need a API to pass from thhe chisel the vlen (you can implement this in this PR if you want)

@@ -104,6 +111,27 @@ extern "C" void cospike_cosim(long long int cycle,
uint64_t default_boot_addr = 0x80000000;
boot_addr_reg->store(0, 8, (const uint8_t*)(&default_boot_addr));

for (auto& mem : mems) {
if (mem.first == info->mem0_base) {
std::string path_name = "chipyard-cosim-" + std::to_string(getpid());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the memory matching stuff, this needs the SimDRAM memory channel dupllication issue to be fixed.

}
printf("\n");
}
if (valid || raise_interrupt || raise_exception) {
p->step(1);
#ifdef SPIKE_DEBUG
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the runtime flag

printf("%d PC mismatch spike:%lx != dut:%lx\n", cycle, s_pc, iaddr);
printf("%d PC mismatch spike %llx != DUT %llx\n", cycle, s_pc, iaddr);
#ifdef SPIKE_DEBUG
printf("spike mstatus is %lx\n", s->mstatus->read());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use runtime flags, not compile-time

for (auto memwrite : mem_write) {
reg_t waddr = std::get<0>(memwrite);
uint64_t w_data = std::get<1>(memwrite);
if (waddr == CLINT_BASE && w_data == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think CLINT_BASE is right, as it assumes hartid=0. Shouldn't it calculate the hartid based on address?


for (auto &regwrite : log) {

// if (regwrite.first == 0) continue;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comment

bool ignore_read = (!mem_read.empty() &&
((magic_addrs.count(mem_read_addr) ||
(tohost_addr && mem_read_addr == tohost_addr) ||
(fromhost_addr && mem_read_addr == fromhost_addr) ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: fix the alignment here.

Signed-off-by: Tianrui Wei <tianrui@tianruiwei.com>


<<<<<<< HEAD
for (auto memwrite : mem_write) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge issue


<<<<<<< HEAD
if (scalar_wb ^ has_wdata) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More merge conflicts


auto& mem_write = s->log_mem_write;
auto& log = s->log_reg_write;
auto& mem_read = s->log_mem_read;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation

Signed-off-by: Tianrui Wei <tianrui@tianruiwei.com>
@jerryz123 jerryz123 merged commit 44ef2e3 into ucb-bar:tcdtm Apr 20, 2023
@tianrui-wei tianrui-wei deleted the cospike-rebase branch April 20, 2023 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants