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

update Mycelium dependencies #343

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

update Mycelium dependencies #343

wants to merge 10 commits into from

Conversation

hawkw
Copy link
Contributor

@hawkw hawkw commented Oct 13, 2024

This updates everything to hawkw/mycelium@ba56bb4.

Copy link
Contributor Author

@hawkw hawkw left a comment

Choose a reason for hiding this comment

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

trying to figure out why the timer is wedged on D1

@@ -344,22 +337,16 @@ impl D1 {
}
}

timer0.start_counter(0xFFFF_FFFF);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wonder if this line moving is why the D1 is wedged. The new code has moved the call to start_counter into Timer0::into_maitake_clock, which gets called before PLIC setup. Perhaps starting the counter before the PLIC is configured breaks something...

Comment on lines +14 to +15
self.set_prescaler(TimerPrescaler::P8); // 24M / 8: 3.00M ticks/s
self.set_mode(TimerMode::PERIODIC);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same prescaler and mode configuration we set in the older code, so that's presumably not the problem...

Copy link
Contributor Author

@hawkw hawkw left a comment

Choose a reason for hiding this comment

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

more notes

Comment on lines +29 to +32
SystemTime::now()
.duration_since(SystemTime::UNIX_EPOCH)
.unwrap()
.as_micros() as u64
Copy link
Contributor Author

Choose a reason for hiding this comment

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

probably we could make this use Instant rather than SystemTime, but we'd need to stuff an initial start time Instant in a global so that this function can get at it. eventually i'd like to redo the Clock API to let you actually put data into the Clock at init...

if let Some(timer) = ptr::NonNull::new(TIMER.load(Ordering::Acquire)) {
unsafe { timer.as_ref() }.advance_ticks(1);
}
IDIOTIC_CLOCK_TICKS.fetch_add(1, Ordering::Relaxed);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

XXX ELIZA THIS SUCKS SO BAD LOL

Comment on lines 75 to 76
// TODO(anatol) please fix this for me thanks :)
unimplemented!("FIGURE OUT HOW TO GET A NORMAL TIMESTAMP OUT OF WASM LOL")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

one way to make this work with the current Clock interface is to stuff a DateTime<Local> into a global so it can be grabbed by this function. i'll probably just go do that.

perhaps there's a nicer way to get a global integer timestamp on wasm, but i don't know what it is.

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.

1 participant