Documentation
¶
Overview ¶
Package edif Contains various structures, and functions related to the modification and parsing of EDIF (Electronic Design Interchange Format) files. This can be used for example to manipulate the netlist of a circuit which is produced by EDA tools, like Vivado.
Index ¶
- func Write(edif *Edif) error
- type Edif
- type ElementType
- type Identifier
- type Integer
- type Keyword
- type List
- func (edifList *List) Children() *list.List
- func (edifList *List) DataType() ElementType
- func (edifList *List) Identifier() *Identifier
- func (edifList *List) InsertElement(element ListElement, after ListElement) error
- func (edifList *List) Keyword() *Keyword
- func (edifList *List) ListAllChildren() []*List
- func (edifList *List) ListChildren() []ListElement
- func (edifList *List) PushElement(element ListElement)
- func (edifList *List) RemoveElement(element ListElement) error
- func (edifList *List) Value() any
- type ListElement
- type String
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Edif ¶
type Edif struct {
// contains filtered or unexported fields
}
Edif Models the EDIF file. Is essentially holding the whole tree of netlists.
func Read ¶
Read Reads the contents of an edif file, translating it into an EDIF data structure. It returns the EDIF representation if succeeded, otherwise an error is returned indicating the cause of failure.
type ElementType ¶
type ElementType uint32
ElementType Represents a datatype present in the EDIF file.
const ( // ListType Represents a component of the EDIF file. ListType ElementType = 1 // StringType Represents a string present in the EDIF file. StringType ElementType = 2 // IntegerType Represents an integer present in the EDIF file. IntegerType ElementType = 3 // KeywordType Represents a keyword present in the EDIF file. KeywordType ElementType = 4 // ListIdentifierType Represents the identifier of a component, present in the // EDIF file. ListIdentifierType ElementType = 5 // UnknownType indicates that the type of datatype in the EDIF file, is // not yet known. UnknownType ElementType = 6 )
type Identifier ¶
type Identifier struct {
// contains filtered or unexported fields
}
func CreateIdentifier ¶
func CreateIdentifier(value string) *Identifier
func (*Identifier) DataType ¶
func (edifIdentifier *Identifier) DataType() ElementType
func (*Identifier) Value ¶
func (edifIdentifier *Identifier) Value() any
type Integer ¶
type Integer struct {
// contains filtered or unexported fields
}
func CreateInteger ¶
func (*Integer) DataType ¶
func (edifInteger *Integer) DataType() ElementType
type Keyword ¶
type Keyword struct {
// contains filtered or unexported fields
}
func CreateKeyword ¶
func (*Keyword) DataType ¶
func (edifKeyword *Keyword) DataType() ElementType
type List ¶
type List struct {
// contains filtered or unexported fields
}
func CreateList ¶
func CreateList( keyword *Keyword, identifier *Identifier, values list.List, ) *List
func (*List) DataType ¶
func (edifList *List) DataType() ElementType
func (*List) Identifier ¶
func (edifList *List) Identifier() *Identifier
func (*List) InsertElement ¶
func (edifList *List) InsertElement( element ListElement, after ListElement, ) error
InsertElement Inserts a new netlist element after the provided, new element. If err = nil, the element was inserted successfully, otherwise an error is returned indicating the cause of failure.
func (*List) ListAllChildren ¶
ListAllChildren Stores every component of the EDIF file into a slice of pointers by doing there is no requirement to know the nested order of the EDIF to access a specific component. It returns the slice of pointers to all the components.
func (*List) ListChildren ¶
func (edifList *List) ListChildren() []ListElement
ListChildren Lists all the netlist components which belong to a parent component.
func (*List) PushElement ¶
func (edifList *List) PushElement(element ListElement)
func (*List) RemoveElement ¶
func (edifList *List) RemoveElement(element ListElement) error
RemoveElement Removes the netlist element provided. If succeeded err = nli, otherwise an error is returned indicating the cause of failure.
type ListElement ¶
type ListElement interface {
// Value Gets the value of the datatype (string, keyword, integer, e.t.c).
Value() any
// DataType Gets the datatype code (ListIdentifierType, KeywordType, e.t.c).
DataType() ElementType
}
ListElement Represents ANY datatype present in the EDIF file.