//! //! # vlsir Circuit Schema //! syntax = "proto3"; package vlsir.circuit; import "utils.proto"; // # Package // A Collection of Modules and ExternalModules message Package { // Domain Name string domain = 1; // `Module` Definitions repeated Module modules = 2; // `ExternalModule` interfaces used by `modules`, and available externally repeated ExternalModule ext_modules = 3; // Description string desc = 10; } // # Port // An externally-visible `Signal` with a `Direction`. message Port { enum Direction { INPUT = 0; OUTPUT = 1; INOUT = 2; NONE = 3; } string signal = 1; // Reference to `Signal` by name Direction direction = 2; // Port direction } // # Signal // A named connection element, potentially with non-unit `width`. message Signal { // Signal Name string name = 1; // Bus Width int64 width = 2; } // # Signal Slice // Reference to a subset of bits of `signal`. // Indices `top` and `bot` are both inclusive, similar to popular HDLs. message Slice { // Parent Signal Name string signal = 1; // Top Index int64 top = 2; // Bottom Index int64 bot = 3; } // Signal Concatenation // FIXME: documentation of ordering, MSB-LSB message Concat { repeated ConnectionTarget parts = 1; } // # ConnectionTarget Union // Enumerates all types that can be // (a) Connected to Ports, and // (b) Concatenated message ConnectionTarget { oneof stype { string sig = 1; // Reference to `Signal` (name) `sig` Slice slice = 2; // Slice into signals Concat concat = 3; // Concatenation of signals } } // # Port Connection // Pairing between an Instance port (name) and a parent-module ConnectionTarget. message Connection { string portname = 1; ConnectionTarget target = 2; } // Module Instance message Instance { // Instance Name string name = 1; // Reference to Module instantiated vlsir.utils.Reference module = 2; // Parameter Values repeated vlsir.utils.Param parameters = 3; // Port `Connection`s repeated Connection connections = 4; } // Module - the primary unit of hardware re-use message Module { // Module Name string name = 1; // Port List, referring to elements of `signals` by name // Ordered as they will be in order-sensitive formats, such as typical netlist formats. repeated Port ports = 2; // Signal Definitions, including externally-facing `Port` signals repeated Signal signals = 3; // Module Instances repeated Instance instances = 4; // Parameters repeated vlsir.utils.Param parameters = 5; // Literal Contents, e.g. in downstream EDA formats repeated string literals = 6; } // Spice Type, used to identify what a component is in spice enum SpiceType { // The default value is implicitly SUBCKT SUBCKT = 0; RESISTOR = 1; CAPACITOR = 2; INDUCTOR = 3; MOS = 4; DIODE = 5; BIPOLAR = 6; VSOURCE = 7; ISOURCE = 8; VCVS = 9; VCCS = 10; CCCS = 11; CCVS = 12; TLINE = 13; } // # Externally Defined Module // Primarily for sake of port-ordering, for translation with connect-by-position // formats. message ExternalModule { // Qualified External Module Name vlsir.utils.QualifiedName name = 1; // Description string desc = 2; // Port Definitions // Ordered as they will be in order-sensitive formats, such as typical netlist formats. repeated Port ports = 3; // Signal Definitions, limited to those used by external-facing ports. repeated Signal signals = 4; // Params repeated vlsir.utils.Param parameters = 5; // Spice Type, SUBCKT by default SpiceType spicetype = 6; } // # Interface // Defines the logical IO of a `Module` message Interface { // Cell Name string name = 1; // Port List repeated Port ports = 10; }