iec61499converter

package
v0.0.0-...-aee3c85 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CECCTransition

type CECCTransition struct {
	IfCond    string
	AssEvents []string
}

CECCTransition is used with getCECCTransitionCondition to return results to the template

type Converter

type Converter struct {
	Blocks []iec61499.FB

	ConverterSettings

	InstG []eca.InstanceNode
	// contains filtered or unexported fields
}

Converter is the struct we use to store all blocks for conversion (and what we operate from)

func New

func New(language string) (*Converter, error)

New returns a new instance of a Converter based on the provided language

func (*Converter) AddBlock

func (c *Converter) AddBlock(iec61499bytes []byte) error

AddBlock should be called for each block in the network

func (*Converter) ConvertAll

func (c *Converter) ConvertAll() ([]OutputFile, error)

ConvertAll converts iec61499 xml (stored as []FB) into vhdl []byte for each block (becomes []VHDLOutput struct) Returns nil error on success

func (*Converter) CvodeEnable

func (c *Converter) CvodeEnable() error

CvodeEnable enables using C CVODE library from SUNDIALS to solve algorithms with 'ODE' and 'ODE_init' in comment fields

func (*Converter) DisableAlgorithmLanguageChecks

func (c *Converter) DisableAlgorithmLanguageChecks()

DisableAlgorithmLanguageChecks prevents checking for compatible languages inside algorithms

func (*Converter) Flatten

func (c *Converter) Flatten() error

Flatten flattens all CFBs from a network (excluding the parent)

func (*Converter) SetEventQueue

func (c *Converter) SetEventQueue()

SetEventQueue sets that events will be queued and executed one by one, preventing events from being missed this is part of the IEC61499 revision 2 specification

func (*Converter) SetRunOnECC

func (c *Converter) SetRunOnECC()

SetRunOnECC sets that ECCs will "run-on", rather than taking a single transition in a tick this is part of the IEC61499 revision 2 specification

func (*Converter) SetTcrestIncludes

func (c *Converter) SetTcrestIncludes()

SetTcrestIncludes sets that the output fbtypes.h should include the TCREST headers than set and forget

func (*Converter) SetTcrestSmartSPM

func (c *Converter) SetTcrestSmartSPM()

SetTcrestSmartSPM sets that the output should be formatted for T-CREST architecture and use the SPMs for BFB execution

func (*Converter) SetTcrestUsingSPM

func (c *Converter) SetTcrestUsingSPM()

SetTcrestUsingSPM sets a flag that the output should be formatted for the TCREST architecture, specifically, it should put the FBs into SPM memory

func (*Converter) SetTopName

func (c *Converter) SetTopName(name string) error

SetTopName sets the IEC61499 top level entity to the name provided This checks to ensure a valid name

type ConverterSettings

type ConverterSettings struct {
	TcrestUsingSPM           bool
	TcrestSmartSPM           bool
	TcrestIncludes           bool
	IgnoreAlgorithmLanguages bool
	CvodeEnabled             bool
	RunOnECC                 bool //Use IEC61499 v2 specification for ECC logic instead of synchronous logic (i.e. consume single event, run as far as possible vs. run single transition)
	EventQueue               bool //Queue events and run them one by one, disallowing simultaneous events and greatly changing data passing logic
}

ConverterSettings holds the settings for this conversion

type CvodeInit

type CvodeInit struct {
	OdeFName string
	Initials []OdeVar
}

CvodeInit is used in templates when generating code from Cvode_init algorithms

func (CvodeInit) GetInitialValues

func (c CvodeInit) GetInitialValues() []OdeVar

type CvodeTick

type CvodeTick struct {
	Vars     []OdeVar //the internal vars such as X_dot
	EmitVars []OdeVar //the emitted vars such as Y
}

CvodeTick is used to store variables and ode functions when processing ODE states

type OdeVar

type OdeVar struct {
	VarName      string
	VarValue     string
	TriggerValue string //the trigger value (if any) (i.e. the crossing which might trigger a state change)
}

OdeVar is a varname and a varvalue used to store variables and string functions

type OutputFile

type OutputFile struct {
	Name      string
	Extension string
	Contents  []byte
}

OutputFile is used when returning the converted data from the iec61499

type SpecialIO

type SpecialIO struct {
	//Perhaps in future we will have special []Event and []Variable for normal event and data API
	InternalVars []iec61499.Variable
}

SpecialIO is used to store internal variables that are "special" (i.e. exported because they are for debugging or service interfaces)

type TemplateData

type TemplateData struct {
	ConverterSettings

	InstG []eca.InstanceNode

	BlockIndex int
	Blocks     []iec61499.FB
}

TemplateData is the structure used to hold data being passed into the templating engine

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL