### BookSim Configuration File Example Source: https://context7.com/booksim/booksim2/llms.txt A minimal configuration file for an 8x8 2D mesh with uniform random traffic. Parameters include topology, network dimensions, routing function, virtual channel settings, and traffic characteristics. ```properties // Minimal 8×8 2D mesh with uniform random traffic topology = mesh; k = 8; // radix (nodes per dimension) n = 2; // number of dimensions routing_function = dor; // Dimension-Order Routing num_vcs = 8; vc_buf_size = 8; wait_for_tail_credit = 1; vc_allocator = islip; sw_allocator = islip; alloc_iters = 1; credit_delay = 2; routing_delay = 0; vc_alloc_delay = 1; sw_alloc_delay = 1; st_final_delay = 1; input_speedup = 2; output_speedup = 1; internal_speedup = 1.0; traffic = uniform; packet_size = 1; injection_rate = 0.2; sim_type = latency; warmup_periods = 3; sample_period = 1000; sim_count = 1; ``` -------------------------------- ### Configure Anynet Topology with Weighted Links Source: https://context7.com/booksim/booksim2/llms.txt Example of an anynet_file format that includes link weights, specifying channel latency in cycles for specific router-to-router connections. ```plaintext // anynet_file with link weights: // router 0 router 1 10 router 2 5 // (router 1 → router 0 is single-cycle unless stated on router 1's line) ``` -------------------------------- ### Build BookSim using Make Source: https://context7.com/booksim/booksim2/llms.txt Clone the BookSim repository and build the simulator using the provided Makefile. The executable will be located at src/booksim. Use 'make clean' to remove build artifacts. ```bash cd src/ make # Clean build artifacts make clean ``` -------------------------------- ### Run BookSim Simulation with Configuration Files Source: https://context7.com/booksim/booksim2/llms.txt Execute BookSim simulations by providing one or more configuration files as arguments. Command-line key=value pairs can override parameters specified in the configuration files. ```bash # Run with a single config file ./booksim ../runfiles/meshconfig # Override injection rate on the command line (sweep) ./booksim ../runfiles/meshconfig injection_rate=0.5 # Combine a topology base config with a traffic override ./booksim ../runfiles/flatflyconfig traffic=bitcomp injection_rate=0.4 # Run the dragonfly example ./booksim ../runfiles/dragonflyconfig # Run the fat-tree example ./booksim ../runfiles/ftreeconfig # Redirect detailed watch output to a file ./booksim ../runfiles/meshconfig watch_out=trace.txt # Write final statistics to a CSV file ./booksim ../runfiles/meshconfig print_csv_results=1 stats_out=results.csv ``` -------------------------------- ### Configure Anynet Topology from File Source: https://context7.com/booksim/booksim2/llms.txt Sets up an arbitrary user-defined topology by reading network definitions from a specified file. Each line in the file describes a router and its neighbors, with optional link weights for channel latency. ```plaintext topology = anynet; network_file = anynet_file; routing_function = min; traffic = uniform; num_vcs = 1; vc_buf_size = 3; injection_rate = 0.01; sample_period = 10000; ``` -------------------------------- ### Configure Input-Queued (IQ) Router Source: https://context7.com/booksim/booksim2/llms.txt Set up an Input-Queued router with virtual-channel flow control and specify pipeline stage delays, VC configuration, and crossbar speedup. ```plaintext router = iq; // Pipeline stage delays (cycles each) routing_delay = 1; vc_alloc_delay = 1; sw_alloc_delay = 1; st_final_delay = 1; st_prepare_delay = 0; // VC configuration num_vcs = 16; vc_buf_size = 8; // flits per VC buffer wait_for_tail_credit = 1; // 1 = wait for tail before VC reuse (safer) // Crossbar speedup input_speedup = 1; output_speedup = 1; internal_speedup = 1.0; // Speculative switch allocation (VA and SA in parallel) speculative = 1; spec_check_elig = 1; spec_check_cred = 1; ``` -------------------------------- ### Configure Latency Simulation Mode Source: https://context7.com/booksim/booksim2/llms.txt Set up the latency simulation mode with parameters for warmup, sampling, convergence threshold, and maximum samples. Includes an option to abort if average latency exceeds a threshold. ```plaintext sim_type = latency; warmup_periods = 3; sample_period = 1000; max_samples = 10; stopping_thres = 0.05; // 5% convergence threshold latency_thres = 500.0; // abort if avg latency exceeds this (unstable) injection_rate = 0.3; ``` -------------------------------- ### Configure Power Modeling Source: https://context7.com/booksim/booksim2/llms.txt Enable BookSim's technology-parameterized power model. Requires a technology file specifying cell dimensions, capacitances, resistance, and Vdd. Sets output file and channel width. ```booksim sim_power = 1; power_output_file = power_results.txt; tech_file = tech_params.txt; channel_width = 128; // bits per channel channel_sweep = 0; ``` -------------------------------- ### Configure Separable Allocator Source: https://context7.com/booksim/booksim2/llms.txt Use a separable allocator with input port prioritization and a single iteration per cycle for lower hardware cost. ```plaintext // Separable allocator (lower hardware cost) vc_allocator = separable_input_first; sw_allocator = separable_input_first; alloc_iters = 1; ``` -------------------------------- ### Configure Flit and Packet Watching Source: https://context7.com/booksim/booksim2/llms.txt Enable tracing of specific flits and packets by ID. Output can be directed to stdout or a file. Includes deadlock detection timeout and NOC viewer trace. ```booksim // Watch a specific flit and packet by ID watch_flits = 0 5 10; // flit IDs to trace watch_packets = 0 1; // packet IDs to trace // Output all watch events to stdout watch_out = -; // Or to a file watch_out = trace.log; // Enable deadlock detection timeout (cycles before warning) deadlock_warn_timeout = 256; // Enable NOC viewer trace (prints cycle and node for each flit) viewer_trace = 1; ``` -------------------------------- ### Configure Batch Simulation Mode Source: https://context7.com/booksim/booksim2/llms.txt Set up batch simulation mode for request-reply transactions, defining batch size, outstanding requests, and message type to VC range assignments. Useful for modeling memory traffic. ```plaintext sim_type = batch; batch_size = 2000; batch_count = 1; max_outstanding_requests = 4; use_read_write = 1; read_request_size = 1; // flits read_reply_size = 1; write_request_size = 1; write_reply_size = 1; // Assign each message type to a VC range read_request_begin_vc = 0; read_request_end_vc = 5; write_request_begin_vc = 10; write_request_end_vc = 15; read_reply_begin_vc = 8; read_reply_end_vc = 13; write_reply_begin_vc = 2; write_reply_end_vc = 7; ``` -------------------------------- ### Enable Per-Pair Statistics Source: https://context7.com/booksim/booksim2/llms.txt Enable recording of per-source/destination-pair latency statistics. Note that this increases memory usage to O(N²). ```booksim pair_stats = 1; // After simulation, per-pair plat/nlat/flat data is printed to stdout ``` -------------------------------- ### Mesh and Torus Topology Configuration Source: https://context7.com/booksim/booksim2/llms.txt Configure a k-ary n-cube mesh or torus topology. 'k' sets the radix per dimension, and 'n' sets the number of dimensions. Torus includes wrap-around links, while mesh does not. Ensure sufficient VCs for torus to avoid deadlock. ```properties // 8×8 2D mesh (64 nodes) topology = mesh; k = 8; n = 2; routing_function = dor; // dimension-order routing // 8×8 2D torus (64 nodes) topology = torus; k = 8; n = 2; routing_function = dim_order; num_vcs = 2; // need ≥2 VCs to avoid deadlock on torus ``` -------------------------------- ### Configure Throughput Simulation Mode Source: https://context7.com/booksim/booksim2/llms.txt Set up the throughput simulation mode, optimizing for sustained throughput measurement by driving the injection rate towards saturation. ```plaintext sim_type = throughput; warmup_periods = 3; sample_period = 1000; injection_rate = 0.9; // drive toward saturation ``` -------------------------------- ### Configure on_off Traffic Model Source: https://context7.com/booksim/booksim2/llms.txt Set up the on_off bursty traffic model by specifying burst probabilities and rate, or by parameterizing inline. ```plaintext injection_process = on_off; burst_alpha = 0.1; burst_beta = 0.5; injection_rate = 0.1; // Or parameterize inline: on_off(alpha, beta) injection_process = on_off(0.1, 0.5); ``` -------------------------------- ### Configure Event-Driven Router Source: https://context7.com/booksim/booksim2/llms.txt Enable an event-driven virtual cut-through router by setting the router type and enabling VCT. ```plaintext router = event; vct = 1; ``` -------------------------------- ### Configure Chaos Router Source: https://context7.com/booksim/booksim2/llms.txt Select the Chaos Router model, a legacy option for adaptive wormhole switching. ```plaintext router = chaos; ``` -------------------------------- ### Fat Tree Topology Configuration Source: https://context7.com/booksim/booksim2/llms.txt Configure a fat tree topology. 'k' is the degree of the fat tree, and 'n' is the number of levels. 'xr' and 'yr' are also specified for this topology. ```properties // 3-level fat tree with degree 4 topology = fattree; k = 4; n = 3; xr = 2; yr = 2; routing_function = nca; // nearest common ancestor traffic = bitcomp; injection_rate = 0.29; ``` -------------------------------- ### Configure Flatfly Topology Source: https://context7.com/booksim/booksim2/llms.txt Sets up a flattened butterfly topology. Parameters like concentration (c), router radix (k), and dimensions (n) define the network structure. Spatial layout parameters (x, y, xr, yr) are used for latency correction. The limit parameter specifies the number of nodes generating traffic. ```plaintext topology = flatfly; c = 4; k = 4; n = 2; x = 4; y = 4; xr = 2; yr = 2; limit = 64; // only nodes 0..63 generate/accept traffic routing_function = ran_min; // randomized minimal injection_rate = 0.78; ``` -------------------------------- ### Configure Allocator Iterations and Speculative SA Source: https://context7.com/booksim/booksim2/llms.txt Set the number of iterations for VC and switch allocators per cycle and configure speculative switch allocation with priority arbitration. ```plaintext // iSLIP with 4 iterations per cycle (better matching quality) vc_allocator = islip; sw_allocator = islip; alloc_iters = 4; // Speculative SA with priority arbitration speculative = 1; spec_sw_allocator = prio; ``` -------------------------------- ### Configure Multi-Class Traffic Source: https://context7.com/booksim/booksim2/llms.txt Defines a simulation with two traffic classes, each having a different traffic pattern (uniform and bitcomp) and injection rate. The parameters are space-separated lists corresponding to each class. ```plaintext classes = 2; traffic = uniform bitcomp; // class 0: uniform, class 1: bitcomp injection_rate = 0.1 0.05; // per-class rates ``` -------------------------------- ### Configure Bernoulli Injection Process Source: https://context7.com/booksim/booksim2/llms.txt Sets the injection process to Bernoulli, where each node independently generates a packet with a probability equal to the injection rate. This models Poisson arrivals and is the default behavior. ```plaintext injection_process = bernoulli; injection_rate = 0.25; // 0–1.0 packets/node/cycle ``` -------------------------------- ### Configure Dragonflynew Topology Source: https://context7.com/booksim/booksim2/llms.txt Configures the Dragonflynew topology, a high-radix network with groups. Key parameters include routers per group (k), dimensions (n), number of virtual channels (num_vcs), and virtual channel buffer size (vc_buf_size). ```plaintext topology = dragonflynew; k = 4; n = 1; num_vcs = 3; vc_buf_size = 256; routing_function = min; internal_speedup = 1.7; traffic = uniform; injection_rate = 0.2; ``` -------------------------------- ### Configure Adaptive Routing on Mesh Source: https://context7.com/booksim/booksim2/llms.txt Sets up adaptive routing on a mesh topology. Adaptive routing typically requires a higher number of virtual channels (num_vcs) to function effectively. ```plaintext topology = mesh; k = 8; n = 2; routing_function = min_adapt; num_vcs = 4; // adaptive routing typically needs more VCs ``` -------------------------------- ### Configure Valiant (Oblivious) Routing Source: https://context7.com/booksim/booksim2/llms.txt Configures Valiant routing, an oblivious routing strategy that achieves load balancing by routing packets through a random intermediate point. This also requires multiple virtual channels. ```plaintext routing_function = val; num_vcs = 4; ``` -------------------------------- ### Configure Class-Based Priority Source: https://context7.com/booksim/booksim2/llms.txt Set up class-based priority for flits, defining the number of classes and their priority levels. Requires specifying traffic distribution and injection rates per class. ```plaintext // Class-based priority: class 0 has higher priority than class 1 classes = 2; priority = class; class_priority = 1 0; // class 0 priority=1, class 1 priority=0 traffic = uniform uniform; injection_rate = 0.15 0.15; ``` -------------------------------- ### Configure Age-Based Priority Source: https://context7.com/booksim/booksim2/llms.txt Enable age-based flit priority, ensuring older packets receive higher arbitration preference within routers. ```plaintext // Age-based priority (oldest packet first) priority = age; ``` -------------------------------- ### Configure Transpose Traffic on Mesh Source: https://context7.com/booksim/booksim2/llms.txt Sets up transpose traffic on an 8x8 mesh topology with a specified packet size and injection rate. The injection rate is defined in packets per node per cycle. ```plaintext topology = mesh; k = 8; n = 2; routing_function = dor; traffic = transpose; packet_size = 20; injection_rate = 0.005; // packets/node/cycle (not flits) ``` -------------------------------- ### Set Random Seed for Reproducibility Source: https://context7.com/booksim/booksim2/llms.txt Control stochastic elements in the simulation. Use a fixed integer for deterministic runs or 'time' for non-deterministic runs seeded from the system clock. ```booksim seed = 42; // deterministic seed = time; // seeded from wall clock ``` -------------------------------- ### Configure Multiple Subnets Source: https://context7.com/booksim/booksim2/llms.txt Define and assign message types to multiple independent physical networks. This allows for different routing or QoS for different traffic classes. ```booksim subnets = 2; read_request_subnet = 0; read_reply_subnet = 1; write_request_subnet = 0; write_reply_subnet = 1; use_read_write = 1; ``` -------------------------------- ### Full-Featured CMesh Configuration Source: https://context7.com/booksim/booksim2/llms.txt A comprehensive BookSim2 configuration for a concentrated mesh topology. Includes settings for topology, router, virtual channels, allocators, traffic patterns, and output. ```booksim // Full-featured CMesh configuration topology = cmesh; k = 4; n = 2; c = 4; x = 4; y = 4; xr = 2; yr = 2; routing_function = dor_no_express; // Router router = iq; num_vcs = 16; vc_buf_size = 8; wait_for_tail_credit = 1; speculative = 1; spec_check_elig = 1; spec_check_cred = 1; vc_allocator = islip; sw_allocator = islip; alloc_iters = 2; credit_delay = 2; routing_delay = 0; vc_alloc_delay = 1; sw_alloc_delay = 1; st_final_delay = 1; input_speedup = 1; output_speedup = 1; internal_speedup = 1.0; // Traffic (read/write model) sim_type = batch; batch_size = 2000; max_outstanding_requests = 4; use_read_write = 1; read_request_size = 1; read_reply_size = 1; write_request_size = 1; write_reply_size = 1; read_request_begin_vc = 0; read_request_end_vc = 5; write_reply_begin_vc = 2; write_reply_end_vc = 7; read_reply_begin_vc = 8; read_reply_end_vc = 13; write_request_begin_vc = 10; write_request_end_vc = 15; traffic = bitcomp; injection_rate = 0.1; priority = none; warmup_periods = 3; sample_period = 1000; sim_count = 1; seed = 42; // Output print_csv_results = 1; stats_out = cmesh_results.csv; pair_stats = 0; // Power model sim_power = 0; power_output_file = pwr_tmp; channel_width = 128; ``` -------------------------------- ### Configure Random Permutation Traffic with Seed Source: https://context7.com/booksim/booksim2/llms.txt Sets the traffic pattern to random permutation and specifies a seed for the random number generator to ensure reproducibility. ```plaintext traffic = randperm; perm_seed = 42; ``` -------------------------------- ### Concentrated Mesh (cmesh) Topology Configuration Source: https://context7.com/booksim/booksim2/llms.txt Configure a concentrated mesh topology where each router serves 'c' nodes. Node count is k^n * c. This is useful for NoC designs with multiple cores per tile. 'x' and 'y' define router dimensions, while 'xr' and 'yr' define nodes per router. ```properties // 4×4 mesh with 4 nodes per router = 64 total nodes topology = cmesh; k = 4; n = 2; c = 4; x = 4; // routers in X direction y = 4; // routers in Y direction xr = 2; // nodes per router in X yr = 2; // nodes per router in Y routing_function = dor_no_express; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.