-
Notifications
You must be signed in to change notification settings - Fork 367
riscv: add batch.c and batch.h for skip-rti-nop sequence handling #1312
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: riscv
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,7 @@ | |
| #include "field_helpers.h" | ||
|
|
||
| // TODO: DTM_DMI_MAX_ADDRESS_LENGTH should be reduced to 32 (per the debug spec) | ||
| #define DTM_DMI_MAX_ADDRESS_LENGTH ((1<<DTM_DTMCS_ABITS_LENGTH)-1) | ||
| #define DTM_DMI_MAX_ADDRESS_LENGTH ((1 << DTM_DTMCS_ABITS_LENGTH) - 1) | ||
| #define DMI_SCAN_MAX_BIT_LENGTH (DTM_DMI_MAX_ADDRESS_LENGTH + DTM_DMI_DATA_LENGTH + DTM_DMI_OP_LENGTH) | ||
|
|
||
| #define DMI_SCAN_BUF_SIZE (DIV_ROUND_UP(DMI_SCAN_MAX_BIT_LENGTH, 8)) | ||
|
|
@@ -295,14 +295,24 @@ int riscv_batch_run_from(struct riscv_batch *batch, size_t start_idx, | |
| for (size_t i = start_idx; i < batch->used_scans; ++i) { | ||
| if (bscan_tunnel_ir_width != 0) | ||
| riscv_add_bscan_tunneled_scan(batch->target->tap, batch->fields + i, | ||
| batch->bscan_ctxt + i); | ||
| batch->bscan_ctxt + i); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does not seem like a correct formatting fix -- AFAIK, throughout the codebase the prevailing pattern is +2 TABs when inside the braces of a function call, e.g.: |
||
| else | ||
| jtag_add_dr_scan(batch->target->tap, 1, batch->fields + i, TAP_IDLE); | ||
|
|
||
| delay = get_delay(batch, i, delays, resets_delays, | ||
| reset_delays_after); | ||
| if (delay > 0) | ||
| jtag_add_runtest(delay, TAP_IDLE); | ||
| //conditional execution | ||
| const unsigned int out_op = buf_get_u32(batch->fields->out_value, | ||
| DTM_DMI_OP_OFFSET, DTM_DMI_OP_LENGTH); | ||
|
|
||
| if (out_op == DTM_DMI_OP_NOP) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd suggest to keep the logic around delay times inside
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @en-sc so you want me to add this same logic but inside get_delay() right? so the timing logs and scheduling stay consistent.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes |
||
| LOG_TARGET_DEBUG(batch->target, "Skipping RTI for DMI NOP at scan %zu", i); | ||
| /* leave delay == 0 so batch->last_scan_delay becomes 0 for this run */ | ||
| delay = 0; | ||
| } else { | ||
| delay = get_delay(batch, i, delays, resets_delays, | ||
| reset_delays_after); | ||
| if (delay > 0) | ||
| jtag_add_runtest(delay, TAP_IDLE); | ||
| } | ||
| } | ||
|
|
||
| keep_alive(); | ||
|
|
||
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.
Let's separate formatting fixes from functional once for the sake of a sane
git blame.