File tree Expand file tree Collapse file tree 13 files changed +915
-74
lines changed
Expand file tree Collapse file tree 13 files changed +915
-74
lines changed Original file line number Diff line number Diff line change 11target /
22Cargo.lock
33build /
4+
5+ .json
Original file line number Diff line number Diff line change @@ -21,7 +21,11 @@ cargo build --release --bin bebop
2121```
2222
23233 . Run the simulation
24+ 4 .
2425```
2526cd bebop
2627./target/release/bebop
28+
29+ # run in quiet with only workload logs
30+ cargo run --release --bin bebop -- -q
2731```
Original file line number Diff line number Diff line change @@ -11,3 +11,5 @@ path = "src/bin/bebop.rs"
1111sim = " 0.13"
1212serde = { version = " 1.0" , features = [" derive" ] }
1313serde_json = " 1.0"
14+ rustyline = " 14.0"
15+ clap = { version = " 4.5" , features = [" derive" ] }
Original file line number Diff line number Diff line change 11use bebop:: simulator:: sim:: mode:: { SimConfig , StepMode } ;
22use bebop:: simulator:: Simulator ;
3+ use clap:: Parser ;
34
4- use std:: env;
5+ /// Bebop - A RISC-V NPU simulator
6+ #[ derive( Parser , Debug ) ]
7+ #[ command( name = "bebop" ) ]
8+ #[ command( version = "0.1.0" ) ]
9+ #[ command( about = "Bebop simulator developed by buckyball" , long_about = None ) ]
10+ struct Args {
11+ /// Enable step mode (interactive stepping)
12+ #[ arg( short, long) ]
13+ step : bool ,
14+
15+ /// Quiet mode (suppress log messages)
16+ #[ arg( short, long) ]
17+ quiet : bool ,
18+
19+ /// Output trace file path
20+ #[ arg( long, value_name = "FILE" ) ]
21+ trace_file : Option < String > ,
22+ }
523
624fn main ( ) -> std:: io:: Result < ( ) > {
7- let args: Vec < String > = env :: args ( ) . collect ( ) ;
25+ let args = Args :: parse ( ) ;
826
9- let step_mode = if args. iter ( ) . any ( |arg| arg == "-- step" || arg == "-s" ) {
27+ let step_mode = if args. step {
1028 StepMode :: Step
1129 } else {
1230 StepMode :: Continuous
1331 } ;
1432
15- let quiet = args. iter ( ) . any ( |arg| arg == "--quiet" || arg == "-q" ) ;
16-
17- let config = SimConfig { quiet, step_mode } ;
33+ let config = SimConfig {
34+ quiet : args. quiet ,
35+ step_mode,
36+ trace_file : args. trace_file ,
37+ } ;
1838
1939 let mut simulator = Simulator :: new ( config) ?;
2040 simulator. run ( )
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ pub fn inject_message(
2020 content : & str ,
2121) {
2222 let msg = Message :: new (
23- source_id. unwrap_or ( "default " ) . to_string ( ) ,
23+ source_id. unwrap_or ( "host " ) . to_string ( ) ,
2424 source_port. unwrap_or ( "default" ) . to_string ( ) ,
2525 target_model. to_string ( ) ,
2626 target_port. unwrap_or ( "default" ) . to_string ( ) ,
Original file line number Diff line number Diff line change @@ -198,6 +198,7 @@ impl DevsModel for Tdma {
198198 port_name : self . commit_to_rob_port . clone ( ) ,
199199 } ) ;
200200 self . all_bank_read_iter = 0 ; // Reset to avoid re-sending
201+ self . until_next_event = 1.0 ;
201202 has_work = true ;
202203 }
203204
@@ -211,6 +212,7 @@ impl DevsModel for Tdma {
211212 port_name : self . commit_to_rob_port . clone ( ) ,
212213 } ) ;
213214 self . all_bank_write_iter = 0 ; // Reset to avoid re-sending
215+ self . until_next_event = 1.0 ;
214216 has_work = true ;
215217 }
216218
Original file line number Diff line number Diff line change 1+ # Event Trace Visualization
2+
3+ Event trace visualization tools for the Bebop simulator. Analyzes JSON Lines trace files and generates interactive HTML visualizations.
4+
5+ ** graph.py** : Generates an interactive network graph showing module connections and event statistics.
6+ ** timeline.py** : Creates a timeline visualization displaying events for each module over time.
7+
8+ ## Usage
9+
10+ ``` bash
11+ python graph.py trace.jsonl [output.html]
12+ python timeline.py trace.jsonl [output.html]
13+ ```
14+
15+ Both tools read JSON Lines format and produce standalone HTML files viewable in any browser.
You can’t perform that action at this time.
0 commit comments