How joemooney/pacgate works
PacGate compiles YAML packet-filter rules into hardware and software implementations, with simulation and verification outputs derived from the same specification. Its principal workflow is rules input → configuration loading → CLI-directed simulation or code generation → generated artifacts and verification. The README documents additional import, PCAP, and analysis capabilities; their exact internal wiring is not established by the sampled excerpts, so those branches are shown without speculative links. The simulator-app wiring is supported by its backend and UI excerpts.
Main entry points: main.rs PacGate CLI · driver.py Verification Driver · coverage_driven.py Coverage-Directed Tests · loader.rs Rule Loader
Components 21
Rule Compiler
- PacGate CLI
src/main.rs - Rule Loader
src/loader.rs - Filter Model
src/model.rs
Generated Targets
- Verilog Generator
src/verilog_gen.rs - Rust Generator
src/rust_gen.rs - P4 Generator
src/p4_gen.rs
Verification
- Formal Generator
src/formal_gen.rs - Cocotb Generator
src/cocotb_gen.rs - Verification Driver
verification/driver.py - Packet Factory
verification/packet.py - Coverage Collector
verification/coverage.py - Coverage-Directed Tests
verification/coverage_driven.py
Packet Analysis
- PCAP Reader
src/pcap.rs - PCAP Analyzer
src/pcap_analyze.rs - PCAP Generator
src/pcap_gen.rs - Rule Importers
src/acl_import.rs
Simulation Tools
- Rule Simulator
src/simulator.rs - Simulator CLI
src/main.rs - Simulator Web UI
simulator-app/web/app.js - Simulator Backend
simulator-app/server.py
Other components
- Rule Author
Connections 16
- Rule Author → PacGate CLI: provides rules
- PacGate CLI → Rule Loader: loads rules
- Rule Loader → Filter Model: builds config
- PacGate CLI → Verilog Generator: generates RTL
- PacGate CLI → Rust Generator: generates filter
- PacGate CLI → P4 Generator: generates P4
- PacGate CLI → Formal Generator: generates assertions
- PacGate CLI → Cocotb Generator: generates tests
- PacGate CLI → Rule Simulator: simulates packets
- Verification Driver → Packet Factory: builds frames
- Verification Driver → Coverage Collector: collects coverage
- Coverage-Directed Tests → Coverage Collector: reads gaps
- Coverage-Directed Tests → Packet Factory: generates frames
- Simulator Web UI → Simulator Backend: calls API
- Simulator Backend → Simulator CLI: runs simulation
- Simulator CLI → Rule Simulator: evaluates rules