Added resim in cu-caterpillar#364
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds a resimulation mode for the cu-caterpillar example, enabling playback of recorded copper logs.
- Introduces a new
cu-caterpillar-resimbinary to replay and re-simulate copper logs. - Updates the main application to write logs under
logs/and create that directory if missing. - Adds helper scripts (
resim.sh,log.sh) and registers the new binary inCargo.toml.
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/cu_caterpillar/src/resim.rs | New resim binary implementation for replaying copper logs |
| examples/cu_caterpillar/src/main.rs | Switch to persistent logs/ directory and ensure its creation |
| examples/cu_caterpillar/resim.sh | Script to run the resimulation binary |
| examples/cu_caterpillar/log.sh | Updated log reader script with new binary name and path |
| examples/cu_caterpillar/Cargo.toml | Registered cu-caterpillar-resim as a new binary |
| // Create the Copper App in simulation mode. | ||
| #[allow(clippy::identity_op)] | ||
| const LOG_SLAB_SIZE: Option<usize> = Some(1 * 1024 * 1024 * 1024); | ||
| let logger_path = "logs/caterpillarresim.copper"; |
There was a problem hiding this comment.
The resimulation binary hardcodes its input/output paths but does not handle CLI arguments; consider parsing the input log path so the resim.sh argument is used or remove hardcoded values.
| @@ -0,0 +1,2 @@ | |||
| #!/bin/bash | |||
| RUST_BACKTRACE=1 cargo run --bin cu-caterpillar-resim logs/caterpillar.copper | |||
There was a problem hiding this comment.
This script passes logs/caterpillar.copper to the resim binary, but the binary doesn't accept any arguments; align the script or modify the binary to accept the log file path.
Suggested change
| RUST_BACKTRACE=1 cargo run --bin cu-caterpillar-resim logs/caterpillar.copper | |
| export LOG_FILE_PATH=logs/caterpillar.copper | |
| RUST_BACKTRACE=1 cargo run --bin cu-caterpillar-resim |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.