-
Notifications
You must be signed in to change notification settings - Fork 217
Allow dumping of tofino registers as component details #2347
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
base: master
Are you sure you want to change the base?
Conversation
These have been vetted to be safe to dump
drv/sidecar-seq-api/src/lib.rs
Outdated
| pub const TOFINO_DEBUG_REGS: [(DirectBarSegment, TofinoPcieRegs); 2] = [ | ||
| ( | ||
| DirectBarSegment::Bar0, | ||
| TofinoPcieRegs::Bar0(TofinoBar0Registers::PcieDevInfo), | ||
| ), | ||
| ( | ||
| DirectBarSegment::Bar0, | ||
| TofinoPcieRegs::Bar0(TofinoBar0Registers::SoftwareReset), | ||
| ), | ||
| ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where we need to fill out the rest of the registers
|
rmustacc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this together @labbott.
| .debug_port | ||
| .read_direct(segment, offset) | ||
| .map_err(SeqError::from)?) | ||
| ) -> Result<u32, RequestError<FpgaError>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given this is a separate API just returning the raw FPGA error seemed much cleaner/more useful
| SpComponent::SP5_HOST_CPU => Ok(2), | ||
| // The SP3 CPU can report GPIO toggle counts | ||
| SpComponent::SP3_HOST_CPU => Ok(1), | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spurious whitespace change?
| let bounded = if (index.0 as usize) | ||
| > drv_sidecar_seq_api::TOFINO_DEBUG_REGS.len() | ||
| { | ||
| panic!("index out of bounds"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be unreachable, due to the higher level code for enumerating components, right? perhaps this should be more explicit here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going off of the example in mgs_compute_sled.rs but I'll tweak the wording to say this should be unreachable:
These have been vetted to be safe to dump