Documentation
¶
Index ¶
- func Bool(v bool) *bool
- func Float64(v float64) *float64
- type ComponentContract
- type ContractIR
- func (c *ContractIR) EnsureComponent(ref string) ComponentContract
- func (c *ContractIR) Merge(other *ContractIR)
- func (c *ContractIR) Net(net string) (NetContract, bool)
- func (c *ContractIR) Pin(ref string, pin string) (PinContract, bool)
- func (c *ContractIR) PutComponent(component ComponentContract)
- func (c *ContractIR) PutNet(net string, contract NetContract)
- func (c *ContractIR) PutPin(ref string, pin string, contract PinContract)
- type CoverageSummary
- type Direction
- type MissingContractData
- type NetContract
- type PinContract
- type PinRole
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ComponentContract ¶
type ComponentContract struct {
Ref string `json:"ref"`
MPN string `json:"mpn,omitempty"`
Pins map[string]PinContract `json:"pins,omitempty"`
VoltageMax *float64 `json:"voltage_max,omitempty"`
Source string `json:"source,omitempty"`
}
ComponentContract stores component-level limits and per-pin contracts.
type ContractIR ¶
type ContractIR struct {
Components map[string]ComponentContract `json:"components"`
Nets map[string]NetContract `json:"nets"`
MissingContractData []MissingContractData `json:"missing_contract_data,omitempty"`
}
ContractIR is the complete contract view attached to a DesignIR. It can be assembled from several independent sources before rules run.
func NewContractIR ¶
func NewContractIR() *ContractIR
NewContractIR creates an initialized contract container.
func (*ContractIR) EnsureComponent ¶
func (c *ContractIR) EnsureComponent(ref string) ComponentContract
EnsureComponent returns a mutable component contract entry, creating it when needed. Call PutComponent after changing the returned value.
func (*ContractIR) Merge ¶
func (c *ContractIR) Merge(other *ContractIR)
Merge combines another ContractIR into this one. Existing data wins so source order can express precedence without losing later missing-data warnings.
func (*ContractIR) Net ¶
func (c *ContractIR) Net(net string) (NetContract, bool)
Net looks up a contract for a normalized DesignIR net name.
func (*ContractIR) Pin ¶
func (c *ContractIR) Pin(ref string, pin string) (PinContract, bool)
Pin looks up a pin contract by component reference and pin name/number.
func (*ContractIR) PutComponent ¶
func (c *ContractIR) PutComponent(component ComponentContract)
PutComponent writes a component contract back into the ContractIR.
func (*ContractIR) PutNet ¶
func (c *ContractIR) PutNet(net string, contract NetContract)
PutNet attaches or merges a net contract.
func (*ContractIR) PutPin ¶
func (c *ContractIR) PutPin(ref string, pin string, contract PinContract)
PutPin attaches or merges a pin contract for ref/pin.
type CoverageSummary ¶
type CoverageSummary struct {
ComponentsTotal int `json:"components_total"`
ComponentsWithContracts int `json:"components_with_contracts"`
PinsTotal int `json:"pins_total"`
PinsWithContracts int `json:"pins_with_contracts"`
NetsTotal int `json:"nets_total"`
NetsWithContracts int `json:"nets_with_contracts"`
MissingWarnings []string `json:"missing_warnings,omitempty"`
}
CoverageSummary is report-facing coverage data for contract completeness.
func SummarizeCoverage ¶
func SummarizeCoverage(design *ir.DesignIR, contractIR *ContractIR) CoverageSummary
SummarizeCoverage compares DesignIR connectivity with available contracts.
type MissingContractData ¶
type MissingContractData struct {
Kind string `json:"kind"`
Ref string `json:"ref,omitempty"`
Pin string `json:"pin,omitempty"`
Net string `json:"net,omitempty"`
Message string `json:"message"`
}
MissingContractData records known analysis gaps. These become warnings so the report is transparent about what was not checked.
type NetContract ¶
type NetContract struct {
Net string `json:"net"`
VoltageMin *float64 `json:"voltage_min,omitempty"`
VoltageNominal *float64 `json:"voltage_nominal,omitempty"`
VoltageMax *float64 `json:"voltage_max,omitempty"`
LogicFamily string `json:"logic_family,omitempty"`
Source string `json:"source,omitempty"`
}
NetContract stores facts that apply to a whole net, such as inferred or explicitly configured rail voltage.
type PinContract ¶
type PinContract struct {
Ref string `json:"ref,omitempty"`
Pin string `json:"pin,omitempty"`
Role PinRole `json:"role"`
VoltageMin *float64 `json:"voltage_min,omitempty"`
VoltageNominal *float64 `json:"voltage_nominal,omitempty"`
VoltageMax *float64 `json:"voltage_max,omitempty"`
CurrentMax *float64 `json:"current_max,omitempty"`
LogicFamily string `json:"logic_family,omitempty"`
Direction Direction `json:"direction"`
OpenDrain *bool `json:"open_drain,omitempty"`
Source string `json:"source,omitempty"`
}
PinContract is the rule-facing electrical contract for a single component pin.
type PinRole ¶
type PinRole string
PinRole describes what a pin electrically does in a design-neutral way. Rules use these roles instead of package-, symbol-, or EDA-specific names.
const ( RolePowerIn PinRole = "power_in" RolePowerOut PinRole = "power_out" RoleRegulatorOut PinRole = "regulator_out" RoleSource PinRole = "source" RoleGPIO PinRole = "gpio" RoleI2CSDA PinRole = "i2c_sda" RoleI2CSCL PinRole = "i2c_scl" RoleSPI PinRole = "spi" RoleUART PinRole = "uart" RoleMotorOut PinRole = "motor_out" RoleGround PinRole = "ground" RoleUnknown PinRole = "unknown" )