ɵ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrst u v w x y z { | } ~        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQR S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | }!~K"non-portable (Template Haskell) experimentalforsyde-dev@ict.kth.se7Pretty printing class with associated printing options Pretty printing class EJoin two documents vertically leaving n vertical spaces between them 2apply sep to a list of prettyprintable elements, # previously interspersing commas 3Only append if both of the documents are non-empty 3Only append if both of the documents are non-empty 9Enclose in parenthesis only if the document is non-empty 5Enclose in parenthesis only if the predicate is True #non-portable (GHC libraries) experimentalforsyde-dev@ict.kth.seA value of type  (from Unsafe Dynamic) can " implicitly any Haskell value. $It is unsafe because, as opposed to  Data.Dynamic, 3Converts an arbitrary value into an object of type . I It is unsafe because it does not provide type information during the  transformation  Converts a - object back into an ordinary Haskell value. = It is unsafe because there is no way to unsure converting 9 back to the correct original Haskell type. Thus, this K function should be used with care since it can cuase disastrous errors. e.g. disastrousCast :: a -> b 5 disastrousCast = unsafeToDyn . unsafeFromDyn %The following program would coredump 6 main = putStr (disastrousCast 1 :: String) $portable experimentalforsyde-dev@ict.kth.se  State monad containing ZipState KThe state contains the list of values obtained form the foldable container M and a String indicating the name of the function currectly being executed 4pops the first element of the list inside the state 8pop a value form the state and supply it to the second " argument of a binary function %portable experimentalforsyde-dev@ict.kth.se1Obtains the arguments and return type of a given   (normally a function)  together with its Context( (non-empty if the type is polymorphic) TypeRep to observe (args , ret ) &portable experimentalforsyde-dev@ict.kth.seA 6 represents the forall part and constraints of a type  (see ) ( For instance, the context of the type   ( forall a b. (Show a, Show b) => (a,b)    is forall a b. (Show a, Show b) =>  where a and b% are the the context variables and  (Show a, Show b) are the context constraints  constructor $Empty context for monomorphic types 7Tells if the context corresponds to a polymorphic type 0Returns the variable names related to a context  Returns the context constraints  Builds a " type out of a context and a type 1Obtains the arguments and return type of a given   (normally a function)  together with its ( (non-empty if the type is polymorphic) Type to observe (args , ret , ) "Obtains the type constructor of a  together with its  arguments and its ( (non-empty if the type is polymorphic) Type to observe (Constructor, args  , Context) &Form a function type out of two types Argument type  Return type Resulting function HRebuild a type out of a constructor, its argument types and its context  (inverse of ) '(Constructor, type arguments, context)  resulting   Polymorphic types ?Rebuild a function type out of its argument types, return type  and context (inverse of ) '(Constructor, type arguments, context)  resulting   Polymorphic types 9Translate monomorphic Template Haskell Types to TypeReps  If the type os polymorhpic  will be returned 4Obtain the Template Haskel type of a dynamic object Give the template haskell  of a Typeable object  Translate a  to a Template Haskell  )Gives the corresponding Template Haskell  of a  Atransfrom a Typeable type constructor to a Template Haskell Type ' (portable experimentalforsyde-dev@ict.kth.seMaximum tuple size portable experimentalforsyde-dev@ict.kth.se&The data type B is modeled similar to a list. It has two data type constructors. $ constructs the empty vector, while z constructsa vector by adding an value to an existing vector. Using the inheritance mechanism of Haskell we have declared  as an instance of the classes  and . 8| This means that the vector 1:>2:>3:>NullV is shown as  1,2,3.  The function  converts a list into a vector.  The function  converts a vector into a list.  The function % creates a vector with one element.  The function  returns  if a vector is empty.  The function - returns the number of elements in a value.  The function " replaces an element in a vector.  The function  ; returns the n-th element in a vector, starting from zero. The functions  ( returns the first element of a vector. The functions  1 returns all, but the first element of a vector.  The function  ' returns the last element of a vector.  The function  0 returns all but the last elements of a vector.  The function + returns the first n elements of a vector.  The function ) drops the first n elements of a vector.  The function  selects elements in the vector. The first argument gives the initial element, starting from zero, the second argument gives the stepsize between elements and the last argument gives the number of elements.  The function 5 groups a vector into a vector of vectors of size n.  The operator '( +)' concatinates two vectors.  The operator '(<:)') adds an element at the end of a vector. The higher-order function 1 applies a function on all elements of a vector. The higher-order function , applies a function pairwise on to vectors. The higher-order functions T folds a function from the right to the left over a vector using an initial value. The higher-order functions S folds a function from the left to the right over a vector using an initial value. The higher-function v takes a predicate function and a vector and creates a new vector with the elements for which the predicate is true.  The function + zips two vectors into a vector of tuples.  The function - unzips a vector of tuples into two vectors.  The function . shifts a value from the left into a vector.  The function / shifts a value from the right into a vector.  The function ] rotates a vector to the right. Note that this fuction does not change the size of a vector.  The function ] rotates a vector to the left. Note that this fuctions does not change the size of a vector.  The function 5 transforms a vector of vectors to a single vector.  The function  . reverses the order of elements in a vector. ! The function !k behaves in the same way, but starts with the application of the supplied function to the supplied value.   Vector> generateV 5 (+1) 1  <2,3,4,5,6> :: Vector Integer " The function " generates a vector with a given number of elements starting from an initial element using a supplied function for the generation of elements.   Vector> iterateV 5 (+1) 1  <1,2,3,4,5> :: Vector Integer # The function #H generates a vector with a given number of copies of the same element.   Vector> copyV 7 5 # <5,5,5,5,5,5,5> :: Vector Integer $  !"#$   !"#$  !"#portable experimentalforsyde-dev@ict.kth.se$ The function $5 performs a standard Discrete Fourier Transformation % The function %n implements a fast Fourier transform (FFT) algorithm, for computing the DFT, when the size N is a power of 2. $%$%$%portable experimentalforsyde-dev@ict.kth.se&'()*;To judge whether the input bit-vector is in a proper form. Input bit-vector Output boolean value +HTo transform the input integer to a bit-vector with specified number of  bits. Num of the bits The input integer The output bit-vector Helper function of +. ,1To transform the input bit-vecotr to an integer. Helper function of ,. -6To add even parity bit on the bit-vector in the tail. .5To add odd parity bit on the bit-vector in the tail. /0&To remove the parity bit in the tail. 1,To check the even parity of the bit-vector. 2+To check the odd parity of the bit-vector.  &'()*+,-./012 )&('+,-./012* &(''()*+,-./012portable experimentalforsyde-dev@ict.kth.se 3Polynomial data type. 456)Multiplication operation of polynomials. 7#Division operation of polynomials. 8$Addition operations of polynomials. 9 Power operation of polynomials. :Some helper functions below. +To get the coefficients of the polynomial. ;<=>Extended version of ,, which will add zeros to the shorter list. 3456789:;<=> 3548679:;<=> 354456789:;<=>portable experimentalforsyde-dev@ict.kth.se?A signal is defined as a list of events. An event has a tag and a value. The tag of an event is defined by the position in the list. A signal is defined as an instance of the classes  and /. The signal 1 :- 2 :- NullS is represented as {1,2}. @AB The function B converts a list into a signal. C The function C converts a signal into a list. D The function D" creates a signal with one value. E The function E checks if a signal is empty. F The function F2 gives the first value - the head - of a signal. G The function G* gives the rest of the signal - the tail. H The function H returns the n-th event in a signal. The numbering of events in a signal starts with 0. There is also an operator version of this function, '(!-)'. IJ The function J) returns the first n values of a signal. K The function K+ drops the first $n$ values from a signal. L The function L takes three parameters, an offset, a stepsize and a signal and returns some elements of the signal such as in the following example:  1 Signal> selectS 2 3 (signal[1,2,3,4,5,6,7,8,9,10])  {3,6,9} :: Signal Integer M The operator M- adds at an element to a signal at the tail. N The operator N- concatinates two signals into one signal. O The function O returns the length of a finite signal. P The function P0 creates an infinite signal. The first argument fI is a function that is applied on the current value. The second argument x& gives the first value of the signal. $ Signal> takeS 5 (infiniteS (*3) 1) ! {1,3,9,27,81} :: Signal Integer Q The function Q creates a signal with n values x. RThe combinator R takes two processes p1 and p2] and and generates a process network, where a signal is split and processed by the processes p1 and p2. S The function S< transforms a signal into a string of the following format:  ! Signal> writeS (signal[1,2,3,4,5])   1n2n3n4n5n :: [Char] T The function T. transforms a formatted string into a signal.   Signal> readS  1n2n3n4n5n :: Signal Int  {1,2,3,4,5} :: Signal Int ?@ABCDEFGHIJKLMNOPQRST?A@MNIBCDEFGHJKOPQLSTR?A@@ABCDEFGHIJKLMNOPQRSTportable experimentalforsyde-dev@ict.kth.se UThe data type U' has two constructors. The constructor W@ is used to model the absence of a value, while the constructor V" is used to model present values. VWX The function X- converts a usual value to a present value. Y The function Y) converts a value from a extended value. ZThe functions Z% checks for the presence of a value. [The functions [$ checks for the absence of a value. \ The function \Q extends a function in order to process absent extended values. If the input is ("bottom"), the output will also be ("bottom"). ] The function ] is identical to \ and should be used in future. The data type U is defined as an instance of  and . '_' represents the value W< while a present value is represented with its value, e.g. V 1 is represented as '1'. UVWXYZ[\] UWVYX][Z\ UWVVWXYZ[\]portable experimentalforsyde-dev@ict.kth.se ^The data type ^E has an additional parameter, that determines the size of the queue. _`,A queue is modeled as a list. The data type `% modelles an queue of infinite size. abb, pushes one element into an infinite queue. cc3 pushes a list of elements into an infinite queue. dd* pops one element from an infinite queue. ee+ transforms a list into an infinite queue. ff) pushes one element into a finite queue. gg0 pushes a list of elements into a finite queue. hh' pops one element from a finite queue. ii+ transforms a list into an infinite queue. ^_`abcdefghi `a^_bcdefghi ^__`aabcdefghiportable experimentalforsyde-dev@ict.kth.se jThe data type j defines two access patterns. k' Write Adr a'! writes a value into an address. l'Read adr'# reads an address from the memory. mThe data type m is modeled as a vector. nopq The function qL creates a new memory, where the number of entries is given by a parameter. r The function rC gives the new state of the memory, after an access to a memory. A l( operation leaves the memory unchanged. s The function sA gives the output of the memory after an access to the memory. A k, operation gives an absent value as output. jklmnopqrs mnjlkopqrs jlkklmnnopqrs)portable experimentalforsyde-dev@ict.kth.se$%^_`abcdefghijklmnopqrs* portable  experimentalforsyde@kth.seC  !"#?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\] portable experimentalforsyde-dev@ict.kth.se'tThe process constructor to takes a combinational function as argument and returns a process with one input signal and one output signal. uThe process constructor up takes a combinational function as argument and returns a process with two input signals and one output signal. vThe process constructor vr takes a combinational function as argument and returns a process with three input signals and one output signal. wThe process constructor wq takes a combinational function as argument and returns a process with four input signals and one output signal. xThe process constructor xY creates a process network that maps a function onto all signals in a vector of signals. yThe process constructor y works as u*, but takes a vector of signals as input. zThe process constructor z$ delays the signal one event cycle K by introducing an initial value at the beginning of the output signal. G Note, that this implies that there is one event (the first) at the G output signal that has no corresponding event at the input signal. M One could argue that input and output signals are not fully synchronized, M even though all input events are synchronous with a corresponding output D event. However, this is necessary to initialize feed-back loops. Initial state  Input signal Output signal {The process constructor {J delays the signal n events by introducing n identical default values. Initial state Delay cycles  Input signal Output signal |The process constructor | is used to construct a finite state machine process without output decoder. It takes an initial value and a function for the next state decoder. The process constructor behaves similar to the Haskell prelude function |c and has the value of the new state as its output value as illustrated by the following example.  3 SynchronousLib> scanldSY (+) 0 (signal [1,2,3,4])   {1,3,6,10} :: Signal Integer $This is in contrast to the function 4, which has its current state as its output value. .Combinational function for next state decoder Initial state Input signal Output signal }The process constructor } behaves like |, but has two input signals. ~The process constructor ~ behaves like |, but has three input signals. The process constructor  is used to construct a finite state machine process without output decoder. It takes an initial value and a function for the next state decoder. The process constructor behaves similar to the Haskell prelude function |). In contrast to the process constructor |O here the output value is the current state and not the one of the next state.  2 SynchronousLib> scanlSY (+) 0 (signal [1,2,3,4])  {0,1,3,6} :: Signal Integer .Combinational function for next state decoder Initial state Input signal Output signal The process constructor  behaves like , but has two input signals. The process constructor  behaves like , but has three input signals. The process constructor $ is used to model state machines of "Moore"w type, where the output only depends on the current state. The process constructor is based on the process constructor , since it is natural for state machines in hardware, that the output operates on the current state and not on the next state. The process constructors takes a function to calculate the next state, another function to calculate the output and a value for the initial state. GIn contrast the output of a process created by the process constructor > depends not only on the state, but also on the input values. /Combinational function for next state decoder *Combinational function for output decoder Initial state  Input signal Output signal The process constructor  behaves like , but has two input signals. The process constructor  behaves like , but has three input signals. The process constructor melaySY$ is used to model state machines of "Mealy" type, where the output only depends on the current state and the input values. The process constructor is based on the process constructor , since it is natural for state machines in hardware, that the output operates on the current state and not on the next state. The process constructors takes a function to calculate the next state, another function to calculate the output and a value for the initial state. GIn contrast the output of a process created by the process constructor 9 depends only on the state, but not on the input values. 0Combinational function for next state decoder *Combinational function for output decoder Initial state Input signal Output signal The process constructor  behaves like , but has two input signals. The process constructor  behaves like , but has three input signals. The process constructor x discards the values who do not fulfill a predicate given by a predicate function and replaces them with absent events.  The process  takes a function and an initial state and generates an infinite signal starting with the initial state as first output followed by the recursive application of the function on the current state. The state also serves as output value. YThe process that has the infinite signal of natural numbers as output is constructed by  + SynchronousLib> takeS 5 (sourceSY (+1) 0)  {0,1,2,3,4} :: Signal Integer The process constructor  creates a process that fills{ a signal with present values by replacing absent values with a given value. The output signal is not any more of the type U. Default value Absent extended input signal Output signal The process constructor  creates a process that fills a signal with values by replacing absent values by the preceding present value. Only in cases, where no preceding value exists, the absent value is replaced by a default value. The output signal is not any more of the type U. Default value Absent extended input signal Output signal The process constructor  creates a process that synchronizes a signal of absent extended values with another signal of absent extended values. The output signal has the value of the first signal whenever an event has a present value and W% when the event has an absent value.  The process  "zips"1 two incoming signals into one signal of tuples.  The process  works as !, but takes three input signals.  The process  works as  , but takes four input signals.  The process  works as  , but takes four input signals.  The process  works as  , but takes four input signals.  The process  "unzips"& a signal of tuples into two signals.  The process  works as  , but has three output signals.  The process  works as , but has four output signals.  The process  works as , but has four output signals.  The process  works as , but has four output signals.  The process  "zips"/ a signal of vectors into a vector of signals.  The process  "unzips"/ a vector of signals into a signal of vectors.  The process 8 selects always the first value from a signal of pairs.  The process 9 selects always the second value from a signal of pairs. 'tuvwxyz{|}~'tuvwyz{|}~x'tuvwxyz{|}~ portable experimentalforsyde-dev@ict.kth.se The skeleton  is a stochastic variant of  t8. It has an internal stochastic process and selects one C out of two combinatorial functions depending on the output of the  stochastic process. $The seed for the stochastic process The first alternative function  The second alternative function The input signal !The output signal of the process  The skeleton  is a stochastic variant of |.  The seed *The first alternative next-state function  The second alternative function The initial state The input signal The output signal 1 is the stochastic variant of mooreSY. Both the G next-state and the output function is randomly selected based on a  uniform distribution. %The seed for the next-state function !The seed for the output function .First alternative for the next-state function /Second alternative for the next-state function *First alternative for the output function +Second alternative for the output function The initial state The input signal The output signal 1 is the stochastic variant of mealySY. Both the G next-state and the output function is randomly selected based on a  uniform distribution. %The seed for the next-state function !The seed for the output function .First alternative for the next-state function /Second alternative for the next-state function *First alternative for the output function +Second alternative for the output function The initial state The input signal The output signal = generates a signal list of uniformly distributed Int within ) the given range and with a given seed.  The seed 3The interval from which the stochastic values are  taken "The sequence of stochastic values ? is a more general stochastic process. The first argument is a F function f which describes the distribution. For each value v in the E given range (r1,r2), f(v) is the probability that v is generated. HNote, that the user has to make sure that sum(f(v))=1 for v in (r1,r2). 1For illustration consider the following example.   pdist :: Float -> Float  pdist d = 1\/\(2**d\)  pdistsum 1 = pdist 1 1 pdistsum d = \(pdist d\) + \(pdistsum \(d-1\)\)  & pdistnorm :: Float -> Float -> Float 2 pdistnorm dmax d = 1\/((pdistsum dmax) * (2**d)) pdistnorm dmax d" gives the probability of a value <= d; pdistnorm dmax dmax is always 1.0 (Hence, using pdistnorm as a function in  gives an exponantial & distribution for values in the range [0, dmax]. The stochastic distribution  The seed  The range "The sequence of stochastic values  portable experimentalforsyde-dev@ict.kth.se  The process % implements a synchronous model of a B FIFO with infinite size. The FIFOs take a list of values at each B event cycle and output one value. There is a delay of one cycle.  The process  implements a FIFO with finite ? size. The FIFOs take a list of values at each event cycle and 2 output one value. There is a delay of one cycle.  The process * implements a synchronous memory. It uses  access functions of the type 'Read adr' and 'Write adr value'.  The process ( merges two input signals into a single E signal. The process has an internal buffer in order to prevent loss D of data. The process is deterministic and outputs events according = to their time tag. If there are two valid values at on both 9 signals. The value of the first signal is output first.  The function ( groups values into a vector of size n, A which takes n cycles. While the grouping takes place the output . from this process consists of absent values.  The process ( implements a counter, that counts from  min to max. The process  has no input and its output is  an infinite signal.  portable experimentalforsyde-dev@ict.kth.se3FFor the digital-analog conversion we have two different possibilities ' which is determined by this data type . !the last digital value is frozen linear interpolation FThe type of a sub-signal of a continuous signal. It consisits of the > function and the interval on which the function is defined. G The continuous time signal is then defined as a sequence of SubsigCT  elements: Signal SubsigCT EThis constant gives the default time step for sampling and plotting.  Its value is 10ns. @ is a process constructor with one input and one output signal. 5 It instantiates a combinatorial, stateless process. 5The partitioning of the input signal. In other words 5 this gives the time period which is consumed by the ' process during each evaluation cycle. The function that  defines the process  behaviour The input signal "The output signal of the process. $ is a process constructor just like  but operates on  two input signals. 'The partitioning of both input signals -The function defining the process behaviour. The first input signal The second input signal !The output signal of the process , is a delay process which simply delays the I output but does not buffer it. The value at each time t is the same as 0 for the input signal, after the initial delay.  The delay The input signal The output signal 1 shifts the shape of the input signal by delay  to the right.  The delay The input signal The output signal GinitCT takes an initial signal, outputs it and then copies its second G input signal, which is delayed by the duration of the initial signal.  The delay is realized by  !The initial signal output first. )Then this signal is output, but delayed. #The concatation of the two inputs. The state-full constructor  resembles a Mealy machine. !The gamma function which defines  the partitioning of the input  signal. The next state function g  The output encoding function f The initial state The input signal The output signal The state-full constructor  resembles a Moore machine. !The gamma function which defines  the partitioning of the input  signal. The next state function g  The output encoding function f The initial state The input signal The output signal * amplifies an input by a constant factor: The scaling factor The input signal !The output signal of the process " adds two input signals together. The first input signal The second input signal The output signal ( multiplies two input signals together. The first input signal The second input signal The output signal ' takes the absolute value of a signal. The input signal The output signal ; generates a sinus signal with the given frequency defined 2 over a given period. The function is defined as f(x)=sin(2*pi*freq*x). The frequency The interval of the signal The generated signal ?constCT generates a constant signal for a given time duration. +The time duration of the generated signal. "The constant value of the signal. The resulting signal. BzeroCT generates a constant 0 signal for the given time duration. The time duration The generated signal. 3 converts an untimes or synchronous signal into a  continuous time signal.  The process ) converts a signal of the digital domain 5 into a continuous time signal. There are two modes, , E which makes a smooth transition between adjacent digital values and  6, where the analog value directly follows the digital  value. This means that in -mode a staircase function ( remains a staircase function, while in  the staircase . function would resemble at least partially a  saw tooth -curve. :The resolution of the converter is given by the parameter  . Note, that the process # is an ideal component, i.e. there K are no losses due to a limited resolution due to a fixed number of bits. Mode of conversion Duration of input signal Input signal (untimed MoC) $Output signal (continuous time MoC)  The process & converts a continuous time signal to C an untimed or synchronous signal. The first parameter gives the % sampling period of the converter. Note, that the process  is an ideal component, G i.e. there are no losses due to a limited resolution due to a fixed  number of bits. Sampling Period Input signal (continuous time) Output signal (untimed) IapplyF1 applies a function on a sub-signal, which means the function of 3 the subsignal is transformed to another function: FapplyF2 works just like applyF1 but operates on two incoming signals. CapplyG1 is used to apply a next-state function. A very interesting F question is, what should be an argument to the next-state function: @ the incoming function, defining the value of the input signal? 5 or the incoming function and the incoming interval? I or the value of the incoming signal at a particular point, e.g. at the " left most point of the interval? M To give the next-state function the interval itself as argument, would mean G that the process becomes time variant process, i.e. its behaviour is J dependent on the absolute time values. This is not a good thing to have! J Another possibility may be to give a sub-signal that is relative to the K current evaluation, i.e. the left most point is always 0. Would that make  sense? JcutEq partitions the two signals such that the partitioning are identical L in both result signals, but only up to the duration of the shorter of the  two signals: : computes the values of a signal with a given step size. E It returns a list with (x, (f x)) pairs of type [(Rational,Rational)]. The sampling period The signal to be sampled 'The list of (time,value) pairs of the  evaluated signal = allows to see how a signal is partitioned into sub-signals. ' It returns the sequence of intervals. The partitioned signal The sequence of intervals ? plots one signal in a graph with the default sampling period  of 1/#200 of the duration of the signal. The signal to be plotted. A reporting message. A plots a list of signals in the same graph. The sampling period H has to be given as argument. In the graph default label names are used  to identify the signals. The sampling period "The list of signals to be ploted  in the same graph )A messeage reporting what has been done. 2 is the work horse for plotting and the functions  and  % use it with specialising arguments. ? plots all the signals in the list in one graph. If a label is P given for a signal, this label appears in the graph. If the label string is  "", a default label like "sig-1" is used. GIn addition to displaying the graph on the screen, the following files  are created in directory ./fig: ct-moc-graph.eps, an eps file of the complete graph ct-moc-graph.pdf+ A pdf file of the complete graph ct-moc-graph-latex.eps' included by ct-moc-graph-latex.tex ct-moc-graph-latex.tex1 This is the tex file that should be included K by your latex document. It in turn includes , the file ct-moc-graph-latex.eps. 4 These two files have to be used together; 5 the .eps file contains only the graphics, 7 while the .tex file contains the labels and % text. Sampling period <A list of (signal,label) pairs. The signals are plotted and 2 denoted by the corresponding labels in the plot. &A simple message to report completion OvcdGen dumps the values of a list of signal in VCD (Value Change Dump) format =(IEEE Std 1364-2001), which is part of the Verilog standard ( .http://en.wikipedia.org/wiki/Value_change_dump). @There are public domain tools to view VCD files. For instance,  GTKWave ( http://home.nc.rr.com/gtkwave/$) is a popular viewer available for Windows and Linux. $The values are written to the file .fig#ct-moc.vcd. If the file exists, it @is overwritten. If the directory does not exist, it is created. "Sampling period; defines for what % time stamps the values are written. >A list of (signal,label) pairs. The signal values written and & denoted by the corresponding labels. &A simple message to report completion ### portable experimentalforsyde-dev@ict.kth.seThe first parameter of  is a constant integer defining the number of tokens consumed in every evaluation cycle. The second argument is a function on lists of the input type and returning a list of the output type. For instance,   r2 = mapU 1 f  where f :: [Int] -> [Int]  f [x] = [2*x] adefines a process r2 which consumes one token in each evaluation cycle and multiplies it by two. X has an internal state which is visible at the output. The first argument is a function 'gamma' which, given the state returns the number of tokens consumed next. The second argument is the next state function and the third is the initial state. The process constructor  creates a state machine of Moore type. In addition to the next state function they also have an output encoding function. The output depends directly on the internal state. The process constructor  creates a state machine of Moore type. In addition to the next state function they also have an output encoding function. The output depends directly on the internal state. c is used to initialise a signal. Its first argument is prepended to its second argument, a signal. portable experimentalforsyde-dev@ict.kth.seportable experimentalforsyde-dev@ict.kth.se2To generate an infinite Signal of Gaussian values 3To get a uniform random variable in the range [0, 1] @To generate an infinite signal of unit normal random variables,  with the specified seed  To generate the s, v1, v2 value portable experimentalforsyde-dev@ict.kth.seThe process constructor mapDF takes a list of firing rules, a list of corresponding output functions and generates a data flow process with one input and one output signal. The process constructors  zipWithDF takes a list of firing rules, a list of corresponding output functions to generate a data flow process with two input signals and one output signal. The process constructors  zipWith3DF takes a list of firing rules, a list of corresponding output functions to generate a data flow process with three input signals and one output signal. The process constructor scanlDF implements a finite state machine without output decoder in the ForSyDe methodology. It takes a set of firing rules and a set of corresponding next state functions as arguments. A firing rule is a tuple. The first value is a pattern for the state, the second value corresponds to an input pattern. When a pattern matches, the process fires, the corresponding next state is executed, and the tokens matching the pattern are consumed. The process constructor mooreDF implements a Moore finite state machine in the ForSyDe methodology. It takes a set of firing rules, a set of corresponding next state functions and a set of output functions as argument. A firing rule is a tuple. The first value is a pattern for the state, the second value corresponds to an input pattern. When a pattern matches, the process fires, the corresponding next state and output functions are executed, and the tokens matching the pattern are consumed. The process constructor mealyDF implements the most general state machine in the ForSyDe methodology. It takes a set of firing rules, a set of corresponding next state functions and a set of output functions as argument. A firing rule is a tuple. The first value is a pattern for the state, the second value corresponds to an input pattern. When a pattern matches, the process fires, the corresponding next state and output functions are executed, and the tokens matching the pattern are consumed.    portable experimentalforsyde-dev@ict.kth.se!The domain interface constructor  takes a parameter k" and downsamples an input signal. "The domain interface constructors  takes a parameter k and upsamples an input signal. !The domain interface constructor 0 converts two parallel signals into one signal. !The domain interface constructor 1 converts three parallel signals into one signal !The domain interface constructor 0 converts four parallel signals into one signal !The domain interface constructor 0 converts one signal into two parallel signals. !The domain interface constructor 2 converts one signal into three parallel signals. !The domain interface constructor 1 converts one signal into four parallel signals. !The domain interface constructor . converts n parallel signals into one signal. "The domain interface constructors . converts one signal into n parallel signals.    + portable  experimentalforsyde-dev@ict.kth.seytuvwxyz{|}~portable experimentalforsyde-dev@ict.kth.seThe function firSY implements a FIR-filter for the synchronous computational model. All kinds of FIR-filters can now be modeled by means of . The only argument needed is the list of coefficients, which is given as a vector of any size. To illustrate this, an 8-th order band pass filter is modeled as follows. L bp = firSY (vector [0.06318761339784, 0.08131651217682, 0.09562326700432, L 0.10478344432968, 0.10793629404886, 0.10478344432968, M 0.09562326700432, 0.08131651217682, 0.06318761339784 ]) portable experimentalforsyde-dev@ict.kth.seThe solver mode. *Runge Kutta 4 with fixed simulation steps )Tustin tranfer from s-domain to z-domain The FIR filter. Let '[x_n]' denote the input signal, '[y_n]' denote the ouput  signal, and '[h_n]'; the impulse response of the filter. Suppose the length of 5 the impulse responses is M samples. The formula for '[y_n]' is  $sum_{k=0}^{M-1} h_k*x_{n-k}$. Coefficients of the FIR filter  Input signal Output signal KThe autoregressive filter is the simplest IIR filter. It is characterized  by a list of numbers '[a_1,a_2,...,a_M]' called the autoregression " coefficients and a single number b called the gain. M is the order of  the filter. Let '[x_n]' denote the input signal, '[y_n]' denote the ouput  signal. The formula for '[y_n]' is $s"um_{k=1}^M {a_k*y_{n-k}+b*x_n}$. J Although it is an IIR filter, here we only get the same length of ouput  signal as the input signal. Coefficients of the AR filter.  The gain  Input signal Output signal 5The ARMA filter combines the FIR and AR filters. Let '[x_n]' denote the  input signal, '[y_n]'* denote the ouput signal. The formula for '[y_n]' is  $sHum_{k=1}^M {a_k*y_{n-k}+b*x_n} + sum_{i=0}^{N-1} b_i*x_{n-i}$. The ARMA N filter can be defined as the composition of an FIR filter having the impulse  reponse '[b_0,b_1,...,b_N-1]') and an AR filter having the regression  coefficients '[a_1,a_2,...,a_M]' and a gain of '1'. Although it is an IIR O filter, here we only get the same length of ouput signal as the input signal. Coefficients of the FIR filter Coefficients of the AR filter.  Input signal Output signal ?The general linear filter in S-domain at CT-MoC. As the kernel H implementation is in Z-domain, the smapling rate should be specified. D It is used on the S-transformation with the following forms, with + coefficients for the descending powers of s and m < n.  8 b_0*s^m + b_1*s^m-1 + ... + b_m-1*s^1 + b_m*s^0 GH(s) = ------------------------------------------------ (Eq 1) 8 a_0*s^n + a_1*s^n-1 + ... + a_n-1*s^1 + a_n*s^0 IIf we multiply both the numerator and the denominator with s^-n, we get # another equivelent canonical form  ? b_0*s^m-n + b_1*s^m-n-1 + ... + b_m-1*s^1-n + b_m*s^-n GH(s) = ----------------------------------------------------- (Eq 2) : a_0*s^0 + a_1*s^-1 + ... + a_n-1*s^1-n + a_n*s^-n 0To instantiate a filter, with sampling interval 'T ' , we use  % filter1 = sLinearFilter T [1] [2,1] ,to get a filter with the transfer function   1 H(s) = --------  2*s + 1 and  ) filter2 = sLinearFilter T [2,1] [1,2,2] 1to get another filter with the transfer function   2*s +1 H(s) = ----------------  s^2 + 2*s + 2 There are two solver modes,  and . M Caused by the precision problem, the time interval in CT uses Rational data @ type and the digital data types in all the domains are Double. Specify the solver mode Fixed simulation interval 5Coefficients of the polynomial numerator in s-domain 7Coefficients of the polynomial denominator in s-domain Input CT-signal Output CT-signal +Digital filter using Runge Kutta 4 solver. 5RK-4 to solve the 1st-order ODEs, with input signal. The initial time The initial state values #List of the functions of the ODEs. Input signal of steps  Input signal Next state signal HOne step RK-4 for the 1st-order ordinary differential equations (ODEs).  The step Initial value of time #List of the funcitons of the ODEs. 'List of the value at the current state $List of the value at the next state 'The general linear filter in Z-domain. Es2z domain coefficient tranformation with a specified sampling rate. : The Tustin transformation is used for the transfer, with   2(z - 1) G s = ---------- (Eq 3)  T(z + 1)  in which, T is the sampling interval. Sampling rate in Z-domain 5Coefficients of the polynomial numerator in s-domain 7Coefficients of the polynomial denominator in s-domain (Tuple of the numerator and denominator  coefficients in Z-domain CThe Z-domain to ARMA coefficient tranformation. It is used on the  Z-transfer function  ? b_0*z^m-n + b_1*z^m-n-1 + ... + b_m-1*z^1-n + b_m*z^-n GH(z) = ----------------------------------------------------- (Eq 4) : a_0*z^0 + a_1*z^-1 + ... + a_n-1*z^1-n + a_n*z^-n which is normalized as  = b_0/a_0*z^m-n + b_1/a_0*z^m-n-1 + ... + b_m/a_0*z^-n GH(z) = ------------------------------------------------------- (Eq 5) @ 1 + a_1/a_0*z^-1 + ... + a_n-1/a_0*z^1-n + a_n/a_0*z^-n The implementation coudl be  Ay(k) = b_0/a_0*x_k+m-n + b_1/a_0*x_k+m-n-1 + ... + b_m/a_0*x_k-n G (Eq 6) = - a_1/a_0*y_k-1 - ... - a_n/a_0*y_k-n 8Then, we could get the coefficients of the ARMA filter. Coefficients in Z-domain  Coefficients of the ARMA filter Computes the inner product. %Repeat an element for a given times. KMaintain a fixed length of list like Fifo, except the outputs are ignored. ,portable experimentalforsyde-dev@ict.kth.se  !"#$%?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-portable experimentalforsyde-dev@ict.kth.se version of   ! A  URefTable a b & Unsafe References to a value of type a (key of the table)  * Values of type b associated to each key *Here is how we implement Tables of URefs: HA Table is nothing but a unique tag, of type TableTag. TableTag can be M anything, as long as it is easy to create new ones, and we can compare them # for equality. (I chose IORef ()). GSo how do we store URefs in a Table? We do not want the Tables keeping M track of their URefs (which would be disastrous when the table becomes big, 0 and we would not have any garbage collection). HInstead, every URef keeps track of the value it has in each table it is H in. This has the advantage that we have a constant lookup time (if the K number of Tables we are using is small), and we get garbage collection of  table entries for free. "9A unique identifier which univocally designates a table #4An Unsafe Unmutable Reference to a value of type a An $#B is implemented as follows: it has two pieces of information. The M first one is an updatable list of entries for each table it is a member in. G Since the types of the Tables vary, the URef has no idea what type of : values it is supposed to store. So we use dynamic types. LSince it is an updatable list, it is an IORef, which we also use to compare  two $#Cs. The second part is just the value the URef is pointing at (this : can never change anyway since references are unmutable). ,FIXME: why IORef? it should maybe be STRef? > Besides: Is it guaranteed that the values of an IORef 2 are not changed by the garbage collector? $%<Create a new Unsafe Unmutable Reference to a Haskell object HThis operation, as explained in the Observable sharing paper, can cuase / side-effects, since the value returned (the $#) is not determined by : the arguments of the function (i.e. different calls to % with & the same argument return different $#s). &Read the value pointed by the $#. 'Create a new table ($Query the value corresponding to an $# )Add an ($# a, b) pair entry to the table key of the entry value of the entry * version of ' + version of ( , version of ) -4Generates a memoizated version of a function taking $# values ./ version of - 0 version of -  #%&'()*+,-.0 #%&'()*+,-.0.%non-portable (non-standard instances) experimentalforsyde-dev@ict.kth.se2Class used to constrain the arguments (values and ProcFun s) taken by  process constructors 1BGet the associated enumerated type-definitions of certain value,  taking nesting in account. For example:  module MyMod where   data Colour = Blue | Red  deriving (Data, Typeable)  data Shapes = Circle | Square  deriving (Data, Typeable)  2 getEnums (Prst Blue, Circle) = 7 fromList [EnumAlgTy "MyMod.Colour" ["Blue", "Red"], < EnumAlgTy "MyMod.Shapes" ["Circle", "Square"]] 2Read a process type 3GData type describing an algebraic enumerated type (i.e. an algrebraic 1 type whose data constructors have arity zero) 45number of outputs to generate 1234512123445/non-portable (Template Haskell) experimentalforsyde-dev@ict.kth.se 6789:;<=>?<; constructor @ 6789:;<=>?@ 6789:789:;<=><=>?@portable experimentalforsyde-dev@ict.kth.se The function 5 performs a standard Discrete Fourier Transformation  The function 7 implements a fast Fourier transform (FFT) algorithm, ; for computing the DFT, when the size N is a power of 2. ABCDEportable experimentalforsyde-dev@ict.kth.seA System identifier A Port identifier A process identifier 0portable experimentalforsyde-dev@ict.kth.seNFF< represents failure using Left ForSyDeErr or a successful " result of type a using Right a F is implicitly an instance of  [G] ("Error e => MonadError e (Either e))  [H] (Error e => Monad (Either e)) I&type indicating a location in the user' s source  code J0A context: it indicates where an error ocurred. KIn a Process value LIn a Proces Function M In a Process NIn a System definition OEmpty context PA context error: a Q, with context information (indicating where  the error ocurred) RS2Expression translation errors in the VHDL backend TUVWXYZ[\]^_`Unkown identifier a8Where constructs in case alternatives are not supported bc.Guards in case alternatives are not supported d0Function translation errors in the VHDL backend e,A general Error which applies to a function ; (e.g. its name or parameters are not a VHDL identifier, / an error in an inner expression ... ) f.Guards in case alternatives are not supported gMultiple clauses h'Unsupported input pattern in function i#Insufficient number of parameters jUnsupported declaration block kPolymorphic declaration Q*All Errors thrown or displayed in ForSyDe l Other Errors mModelsim Failed nQuartus Failed oUnsupported process pReserved identifier qUnsUpported type r!Expresion untranslatable to VHDL sAFunction untranslatable to VHDL (function name and error raised) t#Incorrect Extended VHDL Identifier u Incorrect Basic VHDL Identifier vEmpty VHDL identifier w)Simulation input signals length mismatch xSignature mismatch yDynamic type mismatch z$Inconsistent System Definition Port {Inconsistent output tag |4Incorrect Declarations provided to create a ProcFun }Not a SysDef variable ~>The system contains components from different subsystems with ( the same Identifiers 4Multiply defined process identifier 1Multiply defined port identifier %Incompatible output interface length 4Incompatible input interface length Incompatible system function Not a variable name $help function for the show instance ,Set a process context from a system context Identifier of the process system context 7Set a process function context from a process context Function name Function location system context 4Set a process value context from a process context Expression value system context EThrows a an error caused by improper use of a user-exported function /User-exported function which cuased the error Error to show Throws an internal error *Function which caused the internal error Error to show ,lift an Either expression to an Error Monad -An error reporting function for Quasi monads E Executing in the monad will stop inmideately after calling qError  Note, it does not work for GHC<6.8  see  /http://hackage.haskell.org/trac/ghc/ticket/1265 The name of the function  called in the splice Error to show ,Stop execution, find the enclosing qRecover D if a recover is not found, it is considered as an internal error 8 and the string provided will used as a reference to  the origin of the error.  Note, it does not work for GHC<6.8  see  /http://hackage.haskell.org/trac/ghc/ticket/1265 4Output a trace message in a quasi monad (similar to ) Print an Error Print a VHDL compilation error "Print a GraphML compilation error IWe make ForSyDeErr an instance of the Error class to be able to throw it  as an exception.  Show errors HGFIJKLMNOPRSTUVWXYZ[\]^_`abcdefghijkQlmnopqrstuvwxyz{|}~KFIJONMLKKLMNOPRRScba`_^]\[ZYXWVUTTUVWXYZ[\]^_`abcdkjihgfeefghijkQ~}|{zyxwvutsrqponmllmnopqrstuvwxyz{|}~1non-portable (Template Haskell) experimentalforsyde-dev@ict.kth.sefunction_call literal @ Literals are expressed as a string (remember we are generating  code, not parsing) element_association  only one choice is allowed 9expression, instead of creating an AST like the grammar F (see commented section below) we made our own expressions which are  easier to handle, but which don't don't show operand precedence 2 (that is a responsibility of the pretty printer) instantiated_unit F Only Entities are allowed and their architecture cannot be specified process_statement  The label is mandatory : Only simple names are accepted in the sensitivity list " No declarative part is allowed "component_instantiation_statement  No generics supported " The port map aspect is mandatory waveform_element  Null is not accepted  waveform ' although it is possible to leave [Expr] empty, that's obviously not  valid VHDL waveform Helper type, it doesn't exist in the VHDL grammar Helper type, it doesn't exist in the VHDL grammar conditional_waveforms 'concurrent_signal_assignment_statement A Only conditional_signal_assignment is allowed (without options) : The LHS (targets) are simply signal names, no aggregates   actual_designator     actual_part & We only accept an actual_designator,  #function_name ( actual_designator ) and type_mark ( actual_designator )  are not allowed  formal_part A We only accept a formal_designator (which is a name after all), = in the forme of simple name (no need for selected names)  #function_name ( formal_designator ) and type_mark ( formal_designator )  are not allowed association_element label port_map_aspect block_statement  Generics are not supported G The port_clause (with only signals) and port_map_aspect are mandatory  The ending [ block_label ] is not allowed concurrent_statement I only block statements, component instantiations and signal assignments  are allowed signal_declaration  We don' t allow the  id1,id2,id3( syntax, only one identifier is allowed  at once G Resolution functions and constraints are not allowed, thus a TypeMark * is used instead of a subtype_indication  Signal kinds are not allowed choice I although any expression is allowed the grammar specfically only allows / simple_expressions (not covered in this AST)  !case_statement_alternative ) it is incorrect to have an empty [Choice] "#helper type, it doesn' t exist in the origianl grammar $%helper type, they doesn' t exist in the origianl grammar &'sequential_statement / Only If, case, return, for loops, assignment, wait for procedure calls  allowed. 6 Only for loops are allowed (thus loop_statement doesn't exist) and cannot  be provided labels. $ The target cannot be an aggregate. / General wait statements are not allowed, only wait for , It is incorrect to have an empty [CaseSmAlt] ()*+,-./0interface_variable_declaration  [variable] is not allowed  We don' t allow the  id1,id2,id3( syntax, only one identifier is allowed  Mode is not allowed G Resolution functions and constraints are not allowed, thus a TypeMark E is used instead of a subtype_indication. If subtyping is required,  declare a subtype explicitly. 12subprogram_specification  Only Functions are allowed  [Pure | Impure] is not allowed / Only an identifier is valid as the designator H In the formal parameter list only variable declarations are accepted 34variable_declaration $ identifier lists are not allowed 56subprogram_declarative_item + only varaible declarations are allowed. 789subprogram_body . No subprogram kind nor designator is allowed :;block_declarative_item < Only subprogram bodies and signal declarations are allowed <=>attribute_name  signatures are not allowed ?@ slice_name ABsuffix / no character or operator symbols are accepted CDEprefix ! only names (no function calls) F indexed_name K note that according to the VHDL93 grammar the index list cannot be empty GHselected_name IJ simple_name Kname ! operator_names are not allowed LMNOPQenumeration_type_definition 0 enumeration literals can only be identifiers RSelement_declaration 3 multi-identifier element declarations not allowed 9 element_subtype_definition is simplified to a type_mark TUrecord_type_definition  [ record_type_simple_name ] not allowed VWarray_type_definition $ unconstrained_array_definition " constrained_array_definition O A TypeMark is used instead of a subtype_indication. If subtyping is required, ! declare a subtype explicitly. XYZtype_declaration E only composite types and enumeration types (a specific scalar type) [\]^type_declaration ) only full_type_declarations are allowed _`discrete_range  only ranges are allowed aindex_constraint bcrange  the direction must always be "to" def constraint $ Only index constraints are allowed gsubtype_indication * resolution functions are not permitted hisubtype-declaration jk only subprogram_body is allowed l package_body  [ PACKAGE ] and [ package_simple_name ] are not allowed mnpackage_declarative_item M only type declarations, subtype declarations and subprogram specifications - (working as subprogram_declaration) allowed opqrpackage_declaration  [ PACKAGE ] and [ package_simple_name ] are not allowed starchitecture_body  [ ARCHITECTURE ] and [ architecture_simple_name ] are not allowed uvmode * INOUT | BUFFER | LINKAGE are not allowed wxy type_mark  We don'3t distinguish between type names and subtype names  We dont'9 support selected names, only simple names because we won't need G name selection (i.e. Use clauses will make name selection unnecesary) zinterface_signal_declaration  We don' t allow the  id1,id2,id3( syntax, only one identifier is allowed  at once  The Mode is mandatory  Bus is not allowed # Preasigned values are not allowed 7 Subtype indications are not allowed, just a typemark F Constraints are not allowed: just add a new type with the constarint # in ForSyDe.vhd if it is required {|}~'Obtain the String of a VHDL identifier Junsafely create a basic VHDLId (without cheking if the string is correct) Eunsafely create an exteded VHDLId (without cheking if the string is  correct) KCreate a VHDL basic identifier from a String, previously checking if the  String is correct FCreate a VHDL extended identifier from a String, previously checking K if the String is correct. The input string must not include the initial B and ending backslashes nad the intermediate backslashes shouldn't be escaped. HUnsafely append a string to a VHDL identifier (i.e. without checking if % the resulting identifier is valid) 5special characters as defined in the VHDL93 standard ;other special characters as defined in the VHDL93 standard Reserved identifiers Logical Operators precedence  Relational Operators Precedence Shift Operators Precedence Plus Operators precedence Sign Operators Precedence  Multplying Operators Precedecne #Miscellaneous Operators Precedence       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"           !""#$$%&&'/.-,+*)(()*+,-./011233455687789::;=<<=>??@AABDCCDEFGGHIIJKPONMLLMNOPQRRSTTUVVWYXXYZ]\[[\]^__`abbceddefghhijjklmmnqpoopqrsstuuvxwwxyz{{|}}~2portable experimentalforsyde-dev@ict.kth.seEEStandard context clause used in all generated vhdl files. It imports 2reset and clock signal identifiers in String form 8reset and clock signal identifiers in basic VHDLId form "types" identifier work identifier std identifier textio identifier range attribute identifier range attribute identifier event attribute identifie default function identifier absent function identifier present function identifier  fromAbstExt function identifier &unsafeFromAbstExt function identifier value element identifier value element suffix *isPresent function and element identifier isAbsent function identifier ?ex (operator ! in original Haskell source) function identifier Esel (function select in original Haskell source) function identifier ltplus (function (<3+) in original Haskell source) function identifier Hplusplus (function (++) in original Haskell source) function identifier empty function identifier Fplusgt (function (+>) in original Haskell source) function identifier singleton function identifier length function identifier Fisnull (function null in original Haskell source) function identifier replace function identifier head function identifier last function identifier init function identifier tail function identifier take function identifier drop function identifier shiftl function identifier shiftr function identifier rotl function identifier reverse function identifier reverse function identifier !toBitVector8 function identifier "toBitVector16 function identifier "toBitVector32 function identifier #fromBitVector8 function identifier $fromBitVector16 function identifier $fromBitVector32 function identifier copy function identifier show function identifier *write function idenfier (from std.textio) )output file identifier (from std.textio) Stardard logic type mark boolean type mark fsvec_index typemark natural typemark "int32 typemark (defined in ForSyDe's VHDL library) "int32 typemark (defined in ForSyDe's VHDL library) "int32 typemark (defined in ForSyDe's VHDL library) !int8 typemark (defined in ForSyDe's VHDL library) string typemark true expression false expression '0' bit expression '1' bit expression tup string record suffix tup VHLID record suffix tup VHDLName suffix EE3non-portable (Template Haskell) experimentalforsyde-dev@ict.kth.se&Number of spaces used for indentation &Prettyprint an binary infix operator 0Accumulated precedence value (initialized to 0) #Enclosing operator (initialized to "") (Precedence of current infix operator lhs expression operator name rhs expression #Prettyprint unary prefix operators 0Accumulated precedence value (initialized to 0) %Precedence of current infix operator operator name operator argument >Prints an expression taking precedence and left associativity  in account 0Accumulated precedence value (initialized to 0) Enclosing operator #Expression curently prettyprinted 4portable experimentalforsyde-dev@ict.kth.se&Write a design file to a file in disk portable experimentalforsyde-dev@ict.kth.se&Automatically generate an instance of ! for one data type. For example: !{-# LANGUAGE TemplateHaskell #-} module Colour where  import Language.Haskell.TH.Lift  data RGB = Red | Green | Blue  %-- Generate the Lift instance of RGB $(deriveLift1 ''RGB)  Version of  deriveLif1* used to automatically generate instances 2 of Lift for multiple data types. For instance: !{-# LANGUAGE TemplateHaskell #-} module Colour where  import Language.Haskell.TH.Lift  data RGB = Red | Green | Blue  $data Num a => Pixel a = Pixel a a a  --- Generate Lift instances for RGB and Pixel $$(mapM deriveLift [''RGB, ''Pixel]) portable experimentalforsyde-dev@ict.kth.se6lift twice, getting the meta AST (the AST of the AST) 5non-portable (Template Haskell) experimentalforsyde-dev@ict.kth.se3A ProcFunAST bundled with its type representation: @ Why a TypeRep and not the Type provided by Template Haskell? ; We could use the type signature provided by TH but ...  1) We don'0t want to force the user to provide a signature  2) We don'5t want to handle polymorphic types. We just want the @ monomorphic type used by the process using the procfun.  Why not just including the  in ProcFunAST? L We need the context of the process to know what monomorphic types are H going to be used. Thus it is imposible to guess the TypeRep within  the code of newProcFun. AA ProcFun bundled with its type representation. This type is not 3 exported to the end user. Only used internally. AST of the function Value of the function $A process Function default argument 0 Either a process function AST or a value AST A process Function AST Default parameters Function Name  (FIXME: maybe just a String?) Function clauses A Process Function AST of the function Value of the function where was it created =Sets a default value for an argument of the process function  >Sets a default value for an argument of the process function 2 when the argument is a process function itself  !Template Haskell constructor for &, here is an example on how to use it  # plus1Fun :: ProcFun (Int -> Int) 2 plus1Fun = $(newProcFun [d| plus1 :: Int -> Int 3 plus1 n = n + 1 |]) 0transform a ProcFun into a Dynamic TypedProcFun +tranform the arguments and return value of  a ProcFun to dynamic 9Check the decarations passed to newProcFun to be correct     6portable experimentalforsyde-dev@ict.kth.se& CA signal can be seen as wire which carries values of certain type F and which can be connected and processed by the two computational @ entities of a ForSyDe system: processes and block instances. A , or more preciselly its root , is after all, how ) signals are implemented in the netlist. )We tie the knot to connect nodes through s, building a Tree which  can have shared nodes. That is done by storing ,s as the the input information of each node M of the tree. Child nodes of the tree are closer to the inputs of the system ( and parents are closer to the outputs.  9The different outputs which the different nodes can have     BThe node connection is carried out by directed edges modelled as D Unsafe Unmutable References (allowing to share nodes) connected B in the output->input direction (remember we are using trees). J Since the node to which the edge is directed can have various outputs C (e.g a system instance) the edge is tagged to indicate to what  output it refers to. A process node E Note that vectors and transformed to lists puls an Int parameter  indicating its size System Instance delaySY process Vector version of UnzipSY Vector version of zipWithNSY mapSY and zipWithSY processes A signal with constant value " During all its periods FA node of the netlist can be either a process, component instances or / special nodes to help traversing the graph. CSince the netlist graph is implemented with trees, they only store K information about their inputs (which are their child nodes in the tree). Input Ports of the system  Processes FThe netlist of a system is modelled as a directed cyclic graph but is J really equivalently implemented as a set of (possibly overlapping) trees ( capable of sharing nodes between them. GThere is no specific data structure for the netlist itself. Instead, a L netlist is simply represented by its outputs. Each output is the root node  of a tree (:). The NlTrees can (and probably will) have common nodes. GIt is important to note that, due to the use of trees, the only way to  traverse a $ is from its outputs to its inputs.  Get the output tags of a node !Get the tag of a signal "!Generate a signal pointing to an  node #Generate a reference to a new  node $%Generate the output signal of a node Reference to the node  Output tag %=Evaluate the output of a process within a synchronous period 4 The inputs and outputs are given in dynamic form &       !"#$%&           !"#$%portable experimentalforsyde-dev@ict.kth.se  7portable experimentalforsyde-dev@ict.kth.se @Multiparameter class to transform a System Function into an IO F Simulation Function, able to externally simulate a System using a - list-based representation of its signals. &Transforms a TH//String version of a simulation function into a # standard simulation function.  Again, the length of input/&output lists of the list version must ? match with the argument number and return tuple size of the  simulation function. TH/String-list simfun accumulated dynamic values  (must be initialized to [])  GMultiparameter class to transform a System Function into a Simulation J Function, able to simulate a System using a list-based representation  of its signals. ';Transforms a dynamic-list version of a simulation function ( into a standard simulation function.  Note the length of input/2output lists of the list version must match with I the argument number and return tuple size of the simulation function. dynamic-list simfun accumulated dynamic values  (must be initialized to []) AClass used to describe a System function. It uses the same trick  as  Text.Printf0 to implement the variable number of arguments. (DGets the result of applying a system function to input port signals * whose name is given in first argument. 1 In case the input id list is not long enough, "default" will be used % as the id of the remaining ports. "ids used to build the input ports 1(output signals returned by the system function,  types of input ports,  types of output ports) )@Transforms a primitive-signal-list version of a system function $ into a standard system function.  Note the length of input/2output lists of the list version must match with E the argument number and return tuple size of the system function. primitive-signal-list sysfun accumulated primitive signals  (must be initialized to []) *number of outputs to generate +=Given a function type expressed with Template Haskell, check C whether it complies with the expected type of a system function @ and, in that case, provide the type and number of the system  inputs and outputs. ,8Check the output types of the system function given its & constructor and its type arguments -.(Check if a type corresponds to a signal /(Unsafely transform from a dynamic value 0Parse a proctype value  & '()*+  && ''()()*+8non-portable (LSTV) experimentalforsyde-dev@ict.kth.se1@Traversing monad, stacking state and error transformers over ST 2@Traversing monad, stacking state and error transformers over IO 3BtraverseSIO traverses a netlist and returns a final user-defined  traversing state (s ) given: J new: generates a new (and normally unique) tag for the outputs of each K netlist node given the traversing state (which is possibly updated  as well). E define: given the output tags of a node, current iteration state, / and the output tags of its children, define A generates the netlist of that node, possibly updating  the traversing state  FIXME: shoudn'3t the arguments of define go the other way around? # first inputs then outputs. - FIXME: why are tags needed in define? [oinfo] should be enough. M tags are ugly in general (see the pattern matches) fix this problem. new define 4-monad version of 3 new define 56Obtain the arguments of a node 1234561234569portable experimentalforsyde-dev@ict.kth.se%7Output interface 8The System Definition value 9!The Primitive System Definition. @ Instead of just providing the value, a reference is provided ' to allow sharing between instances. :;?We add a phantom parameter to indicate the type of the system <=>>Interface, describes the input or output ports of the system. : Each entry contains the name of the port and its type. ?@EIn order to check the system for identifier duplicates we keep track J of the process identifiers and of the accumulated subsytem definitions ABCDE"Location of the call to newSysDef ( which created this System definition $ (used for later error reporting) ( It will initialized or not depending # on the newSysDef* function used FIdentifier of the System GSystem netlist H%List of all unique nested subsystems - (i.e. flattened tree, without duplicates, / of all the systems in lower levels of the  hierarchy) IJ of the system KInput interface LJ9Indicates wether a system is combinational or sequential I In practice, a system is sequential if if contains a delay process or > a sequential system instance, otherwise its combinational. MN constructor KBuilds a system definition out of a system function describing the system  and its port identifers. system function System identifier "Input interface port identifiers #Output interface port identifiers CURRENTLY BROKEN, do not use! ' constructor, Template Haskell version KBuilds a system definition out of a system function, a system identifiers  and its port identifers.  For example $(newSysDefTH mySysFun "mysys" ["in1"] ["out1"]) creates a ( system definition from system funcion mySysFun which should have  one input and output signals. The advantage of  over  is that it I reports errors (e.g duplicated port and process identifiers) earlier, , at host-language (Haskell) compile-time. 1In addition, due to the use of Template Haskell,  is > aware of the source location at which it was called, making 0 further error reports friendlier to the user. system function System identifier "Input interface port identifiers #Output interface port identifiers  constructor, Template Haskell O version  Builds a & out of the name of a system function  and its port identifers. 5The system will later be identified by the basename , (i.e. unqualified name) of the function.  For example $(newSysDefTHName ' mySysFun ["in1"] ["out1"]) creates a ( system definition from system funcion mySysFun which has one input and  output signals. The advantage of  over  is that it  doesn''t suffer from the Template Haskell bug  /http://hackage.haskell.org/trac/ghc/ticket/18006, or in other words, it allows to declare the system 5 defintion and system function in the same module. However, since it doesn',t have acces to the system function itself, N it can only give early error reports related to incorrect port identifiers F (process identifier duplicate errors will be reported at runtime). Name of the system function "Input interface port identifiers "Output interface port identifiers PError prone version of  system function  Location where the originating  call took place (if available) System function "Input interface port identifiers #Output interface port identifiers QACheck that the system definition ports match certain lengths and  don't containt duplicates System currently being checked  input ports and expected length !output ports and expected length RBCheck that the system netlist does not contain process identifier > duplicates (i.e. different processes with the same process K identifier) or instances of different systems with the same identifier. K In case there are no duplicates, the list of nested subsystems together # with the the logic is returned. STU7Generate a lambda expression to transform a tuple of N   s into a  a list of s size of the tuple VFind a duplicate in a list W<Generate a TypeRep expression given a Template Haskell Type J note that the use of typeOf cannot lead to errors since all the signal L types in a system function are guaranteed to be Typeable by construction XGGenerate an interface given its identifiers and Template Haskell Types 789:;<=>EFGHIKLJMN78EFGHIK7L9:;:;<=<=>EFGHIKLJNMMN:non-portable (Template Haskell) experimentalforsyde-dev@ict.kth.se;portable experimentalforsyde-dev@ict.kth.seGenerates an instance of a  in the form of ! function out of the name of a  with the same type as its I system function. The resulting function can then be used to plug the ' instance to the rest of the system. Ynon-portable (Template Haskell) experimentalforsyde-dev@ict.kth.se    %non-portable (Template Haskell, LSTV) experimentalforsyde-dev@ict.kth.se Z[\]^5 takes a system definition and generates a function = able simulate a System using a list-based representation  of its signals. _`abcBcheck that there will only be output as long as there are inputs number of inputs transposed inputs %transposed outputs (infinitie list) selected outputs <portable experimentalforsyde-dev@ict.kth.seXdGIntermediate signal information. Tag generated for each output of each % node found during the traversal. - (see ForSyDe.Netlist.Traverse.traverseSIO). M It contains the VHDL intemediate signal name associated with the process  output. Action to perform by Quartus  Compile flow Call map executable Analysis and eleboration flow LOptions passed to Quartus II by the VHDL Backend. Most of them are optional ) and Quartus will use a default value.  It contains:  What action to perform K Optinally, the minimum acceptable clock frequency (fMax) expressed in MHz J FPGA family and specific device model (both are independently optional). 9 Pin assignments, in the form (VHDL Pin, FPGA Pin). Note C that Quartus will automatically split composite VHDL ports KRecursivity, should the parent systems of system instances be compiled as  well?  ! Debug level "#$VHDL Compilation options %& Debug mode '((Analyze the generated code with Quartus ))Compile the generated code with Modelsim e<Global Results accumulated throughout the whole compilation fghij;Local result accumulated during the traversal of a netlist klmnopqrstuvwxyz{|VHDL traversing State. (see $ForSyDe.Netlist.Traverse.traverseSIO) }~VHDL backend monad AFunction translation state. State used during the translation of  ProcFuns to VHDL. @This type provides the number of fresh names already generated, F a translation table from Template Haskell Names to VHDL Expressions 3 (a symbol table) and auxiliary VHDL declarations. 3It only makes sense in a process-function context. (Initial translation state for functions initialize the local state 7Execute certain operation with a concrete local state. G The initial local state is restored after the operation is executed FExecute certain operation with the initial function translation state A The initial state is restored after the operation is executed Empty initial traversing state  Empty initial traversing state $empty local VHDL compilation result %empty global VHDL compilation result -Print a message to stdout if in verbose mode *COptions to check if the model is synthesizable, all options except + the action to take are set to default. "Check if we are in recursive mode 6Check if we want to compile the results with modelsim +Default traversing options 'Set VHDL options inside the VHDL monad  Add a signal declaration to the kj in the State Add a statement to the kj in the State )Find a previously translated custom type )Add enumerated types to the global state Check if a Template haskell O corresponding to C a Enumerated-type data constructor is present in the enumerated F types accumulated in the global state and return the corresponding  VHDL identifier. BAdd a cutom type to the global results and type translation table +Add type declaration to the global results .Add subtype declaration to the global results 1Add an unconstrained FSVec to the global results 'Add a subprogram to the global results dAdd a TH-name (arity, VHDL expression construtor function) pair to the translation namespace table BAdd a declarations to Auxiliary VHDL declarations of the Function  translation state .Get a fresh VHDL Identifier and increment the @ tranlation-namespace-count of freshly generated identifiers. @Note that all user-supplied identifiers (process ids, port ids, < and function parameters) are translated to extended VHDL E identifiers. That, together with the fact that basic and extended A VHDL identifers live in different namespaces, guarantees that B freshly generated basic VHDL identifiers cannot clash with the " ones supplied by the frontend. Lift an F7 value to the VHDL monad setting current error context  for the error # liftEProne :: EProne a -> VHDLM a 5Throw a ForSyDe error, setting current error context ;Execute certain operation with a concrete process context. C The initial context is restored after the operation is executed 9 Note: the initial context must be a system context or InconsistenContexts  will be raised. DExecute certain operation with a concrete process function context. C The initial context is restored after the operation is executed ; Note: the initial context must be a process context or  InconsistenContexts will be raised. DExecute certain operation with a concrete process function context. C The initial context is restored after the operation is executed ; Note: the initial context must be a process context or  InconsistenContexts will be raised. Xd !"#$%&'()efghijklmnopqrstuvwxyz{|}~*+Xd  !#""#$%&'()%&'()efghifghijklmklmnopqrstuopqrstuvwxyz{wxyz{|}~}~*+=portable experimentalforsyde-dev@ict.kth.se"Generate a list of asignments (in  form) of intermediate signals ? (first argument) to final output signals (second argument) AGenerate a simple signal assignment, from a VHDL identifier to a  VHDL identifier  destination origin #Generate a function call asignment destination signal Function Name Function formal parameters Function actual parameters :Generate a simple assignment from an expression to a name CGenerate a system design file for a system from the global system  identifier, B local traversing results and the translated entity declaration 7Generate a library design file from the global results DGenerate a list of association from two lists of signal identifiers 3 The first one establishes the formal parameters 9Generate a port map from two lists of signal identifiers 4 The first list establishes the formal parameters >Generate a function call from two lists of signal identifiers 4 The first list establishes the formal parameters JGenerate a function call from the Function Name and a list of expressions  (its arguments) ;version of genExprFCall which requires exactly n arguments DGenerate a function call from the Function Name (constant function) List version of genExprFCall0 KGenerate a function call from the Function Name and an expression argument List version of genExprFCall1 MGenerate a function call from the Function Name and two expression arguments List version of genExprFCall2 MGenerate a function call from the Function Name and two expression arguments List version of genExprFCall4 KGenerate a procedure call from the Function Name and a list of expressions  (its arguments) FGenerate a procedure call from the Function Name (constant procedure) LGenerate a procedure call from the Function Name and an expression argument FGenerate a procedure call from the Function Name and four expression  arguments EGenerate a procedure call from the Function Name and two expression  arguments GGenerate the default functions for an unconstrained custom vector type type of the vector elements type of the vector 7Generate the default functions for a custom tuple type type of each tuple element type of the tuple ;Generate the default functions for a custom abst_ext_ type %type of the values nested in AbstExt type of the extended values =Generate the default functions for a custom enumeration type enumeration type &First enumeration literal of the type 0Apply the range attribute out of a simple name >portable experimentalforsyde-dev@ict.kth.se!Analyze the results with Quartus , (Note: the initial and final CWD will be  systemNamevhdl ) $Generate the content of quartus.tcl F Note that, even in windows, the tcl interpreter requires pathnames  to use "/" instead of "\" ?portable experimentalforsyde-dev@ict.kth.se Node Edge Main AST type, a graph   @portable experimentalforsyde-dev@ict.kth.se1EIntermediate edge information. Tag generated for each output of each % node found during the traversal. - (see ForSyDe.Netlist.Traverse.traverseSIO). , It contains the GraphML node identifier ; and port identifier associated with the process output. ,KRecursivity, should the parent systems of system instances be compiled as  well? -./ Debug level 012GraphML Compilation options 3456Generate yFiles markup? <Global Results accumulated throughout the whole compilation  (empty right now) ;Local result accumulated during the traversal of a netlist GraphML traversing State. (see $ForSyDe.Netlist.Traverse.traverseSIO) GraphMLM backend monad initialize the local state 7Execute certain operation with a concrete local state. G The initial local state is restored after the operation is executed Empty initial traversing state  Empty initial traversing state 'empty local GraphML compilation result (empty global GraphML compilation result -Print a message to stdout if in verbose mode "Check if we are in recursive mode +Check if we want to generate yFiles markup 7Default traversing options -Set GraphML options inside the GraphML monad  Add a signal declaration to the  in the State Add a statement to the  in the State Lift an F: value to the GraphML monad setting current error context  for the error 5Throw a ForSyDe error, setting current error context ;Execute certain operation with a concrete process context. C The initial context is restored after the operation is executed 9 Note: the initial context must be a system context or InconsistenContexts  will be raised. 1,-./012345671,.--./10012345634567Anon-portable (Template Haskell) experimentalforsyde-dev@ict.kth.se 'The only accepted pretyprinting option &Number of spaces used for indentation :pretty print a Graph with XML headers and key definitions Eport separation space when connecting to a node which surpasses the  minimum height #Calculate the dimensions of a Node Node dimensions (x,y) 9Calculate the number of input and output ports of a node  Bportable experimentalforsyde-dev@ict.kth.se&Write a design file to a file in disk Cportable experimentalforsyde-dev@ict.kth.se"Internal GraphML-Monad version of 'ForSyDe.Backend.writeGraphML FTraverse the netlist and write the local results (i.e. system graphs) .Traverse the netlist of a System Definition, > returning the (implicit) final traversing state and a list  containing the  of each output of the system 'new'- traversing function for the GraphML backend 'define'- traversing function for the GraphML backend 2,-./01234567portable experimentalforsyde-dev@ict.kth.se83Given a System Definition whose name is A generate  A.graphml in current < working directory using the default compilation options. 987-alternative which allows setting GraphML compilation  options. ,-./01234567898923456/10,.-789portable experimentalforsyde-dev@ict.kth.se:; Low value < High value =Not operation over bits >Convert a bit to a boolean ?Convert a boolean to a bit @ABCDEFGJversion of fromBitVector supplying a default initial value from which to  start working :;<=>?@ABCDEFG:<;=>?@ABCDEFG:<;;<=>?@ABCDEFGportable experimentalforsyde-dev@ict.kth.se HThe data type H' has two constructors. The constructor J@ is used to model the absence of a value, while the constructor I" is used to model present values. IJK The function K- converts a usual value to a present value. L The function L' extracts the inner value contained in H 'Default value returned if the input is J M Similar to L, but without default value NThe functions N% checks for the presence of a value. OThe functions O$ checks for the absence of a value. P The function PQ extends a function in order to process absent extended values. If the input is ("bottom"), the output will also be ("bottom"). Q The function Q is identical to P and should be used in future. The data type H is defined as an instance of  and . '_' represents the value J< while a present value is represented with its value, e.g. I 1 is represented as '1'. HIJKLMNOPQ HJILMKQONP HJIIJKLMNOPQDnon-portable (Template Haskell) experimentalforsyde-dev@ict.kth.se CPhony type used to check if a data constructor is enumerate (has )    Tell if a member of Data belongs to an enumerated type  Tell if a member of Data belongs to an enumerated type  and return its description.             non-portable (Template Haskell) experimentalforsyde-dev@ict.kth.se+R9Creates a constant process. A process which outputs the + same signal value in every clock cycle. Identifier of the process Value to output Resulting output signal SThe process constructor S takes an identifier and a G combinational function as arguments and returns a process with one 0 input signal and one output signal. Identifier of the process &Function applied to the input signal  in every cycle Input   Output   TThe process constructor T takes an identifier and a B combinational function as arguments and returns a process with + two input signals and one output signal. Identifier of the process 'Function applied to the input signals  in every cycle  First input    Second input   Output Signal UThe process constructor U takes an identifier and a C combinational function as arguments and returns a process with / three input signals and one output signal. Identifier of the process Function applied to the input  signals in every cycle  First input    Second input    Third input   Output Signal VThe process constructor V takes an identifier and a C combinational function as arguments and returns a process with . four input signals and one output signal. Identifier of the process Function applied to the  input signals in every cycle  First input    Second input    Third input    Fourth input   Output Signal WThe process constructor W takes an identifier and a C combinational function as arguments and returns a process with . five input signals and one output signal. Identifier of the process Function applied to the  input signals in every cycle  First input    Second input    Third input    Fourth input    Fifth input   Output Signal XThe process constructor X takes an identifier and a C combinational function as arguments and returns a process with . five input signals and one output signal. Identifier of the process Function applied to the  input signals in every cycle  First input    Second input    Third input    Fourth input    Fifth input    Sixth input   Output Signal YThe process constructor Y( creates a process network that maps a K function onto all signals in a vector of signals. The identifier is used M as the identifier prefix of the processes created (a number starting with 1 & will be appended to each identifier) ZThe process constructor Z works as T, but takes a L vector of signals as input. [The process constructor [) delays the signal one event cycle M by introducing an initial value at the beginning of the output signal. M Note, that this implies that there is one event (the first) at the M output signal that has no corresponding event at the input signal. M One could argue that input and output signals are not fully synchronized, M even though all input events are synchronous with a corresponding output D event. However, this is necessary to initialize feed-back loops. Identifier of the process Initial value   to be delayed Resulting delayed   \The process constructor \ delays the signal n events by A introducing n identical default values. It creates a chain of [  processes.  Identifier Initial state Number of Delay cycles  Input signal Output signal ]The process constructor ]& is used to construct a finite state J machine process without output decoder. It takes an initial value and K a function for the next state decoder. The process constructor behaves + similar to the Haskell prelude function ] and has the value of < the new state as its output value as illustrated by the  following example. $This is in contrast to the function `, which has its current  state as its output value. Process Identifier !Combinational function for next  state decoder Initial state Input signal Output signal ^The process constructor ^ behaves like ], but has two  input signals. Process Identifier !Combinational function for next  state decoder Initial state First Input signal Second Input signal Output signal _The process constructor ^ behaves like ], but has two  input signals. Process Identifier !Combinational function for next  state decoder Initial state First Input signal Second Input signal Third Input signal Output signal `The process constructor `% is used to construct a finite state J machine process without output decoder. It takes an initial value and a G function for the next state decoder. The process constructor behaves , similarly to the Haskell prelude function ]. In contrast to the  process constructor ], here the output value is the current state % and not the one of the next state. Combinational function  for next state decoder Initial state Input signal Output signal aThe process constructor a behaves like ` , but has  two input signals. Combinational function  for next state decoder Initial state First Input signal Second Input signal Output signal bThe process constructor a behaves like ` , but has  two input signals. Combinational function  for next state decoder Initial state First Input signal Second Input signal Second Input signal Output signal cThe process constructor c! is used to model state machines  of "Moore"4 type, where the output only depends on the current D state. The process constructor is based on the process constructor  `;, since it is natural for state machines in hardware, that > the output operates on the current state and not on the next C state. The process constructors takes a function to calculate the F next state, another function to calculate the output and a value for  the initial state. GIn contrast the output of a process created by the process constructor  f> depends not only on the state, but also on the input values. Combinational function for  next state decoder *Combinational function for output decoder Initial state  Input signal Output signal dThe process constructor d behaves like c, but has two  input signals. Combinational function for  next state decoder *Combinational function for output decoder Initial state First Input signal Second Input signal Output signal eThe process constructor d behaves like c, but has two  input signals. Combinational function for  next state decoder *Combinational function for output decoder Initial state First Input signal Second Input signal Third Input signal Output signal fThe process constructor melaySY$ is used to model state machines of  "Mealy"> type, where the output only depends on the current state and C the input values. The process constructor is based on the process  constructor `,, since it is natural for state machines in H hardware, that the output operates on the current state and not on the H next state. The process constructors takes a function to calculate the J next state, another function to calculate the output and a value for the  initial state. HIn contrast the output of a process created by the process constructor  c9 depends only on the state, but not on the input values. !Combinational function for next  state decoder *Combinational function for output decoder Initial state Input signal Output signal gThe process constructor g behaves like f , but has  two input signals. !Combinational function for next  state decoder #Combinational function for output  decoder Initial state First Input signal Second Input signal Output signal hThe process constructor g behaves like f , but has  two input signals. !Combinational function for next  state decoder Combinational function for  output decoder Initial state First Input signal Second Input signal Third Input signal Output signal iThe process constructor ix discards the values who do not fulfill a predicate given by a predicate function and replaces them with absent events. Predicate function  Input signal Output signal j The process j5 takes a function and an initial state and generates G an infinite signal starting with the initial state as first output I followed by the recursive application of the function on the current > state. The state also serves as output value. JThe process that has the infinite signal of natural numbers as output is M con structed by  sourceSY "naturals" (+1) 0 kThe process constructor k creates a process that fills a signal K with present values by replacing absent values with a given value. The - output signal is not any more of the type H . .Default value *Absent extended input signal .Output signal lThe process constructor l creates a process that fills a signal K with values by replacing absent values by the preceding present value. H Only in cases, where no preceding value exists, the absent value is J replaced by a default value. The output signal is not any more of the  type H. Default value Absent extended input signal Output signal mThe process constructor m( creates a process that synchronizes a L signal of absent extended values with another signal of absent extended L values. The output signal has the value of the first signal whenever an ! event has a present value and J% when the event has an absent value. n The process n "zips"* two incoming signals into one signal of  tuples. o The process o works as n!, but takes three input signals. p The process p works as n , but takes four input signals. q The process q works as n , but takes five input signals. r The process r works as n, but takes six input signals. s The process s "unzips"& a signal of tuples into two signals. t The process t "unzips"( a signal of tuples into three signals. u The process u "unzips"' a signal of tuples into four signals. v The process v "unzips"' a signal of tuples into five signals. w The process w "unzips"& a signal of tuples into six signals. x The process x "zips"/ a signal of vectors into a vector of signals. y The process y "unzips") a vector of n signals into a signal of  vectors. z The process z7 selects always the first value from a signal of pairs { The process {8 selects always the second value from a signal of pairs | The function |5 groups values into a vector of size n, which takes J n cycles. While the grouping takes place the output from this process  consists of absent values. +RSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|+RSTUVWXZ[\]^_`abcdefghjiklmnopqrstuvwxyYz{|+RSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|portable experimentalforsyde-dev@ict.kth.se0  RSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|  !portable experimentalforsyde-dev@ict.kth.se}8All kinds of FIR-filters can now be modeled by means of }. The E only argument needed is the list of coefficients, which is given as C a vector of any size. To illustrate this, an 8-th order band pass  filter is modeled as follows. V bp = fir "fir Id" $(vectorTH [0.06318761339784, 0.08131651217682, 0.09562326700432, V 0.10478344432968, 0.10793629404886, 0.10478344432968, W 0.09562326700432, 0.08131651217682, 0.06318761339784 ]) }}}Eportable experimentalforsyde-dev@ict.kth.se<Global tranlsation table from Template Haskell function and B constructor Names to VHDL expressions. The table works like this C(function, constant constructor name, (arity, function to obtain a ? VHDL expression < provided its E arguments are already G translated to VHDL )) Fportable experimentalforsyde-dev@ict.kth.se%ATranslate a System Definition to an Entity, explicitly returning / the VHDL identifiers of its output signals. logic of the system system to translate  Translate a  ZipwithNSY/ process to a block returning a declaration of  the resulting signal. process identifier input signals location of the inner function AST of the inner function output signal  Translate a  ZipwithxSY/ process to a block returning a declaration of  the resulting signal. process identifier input signals location of the inner function AST of the inner function output signal  Translate a UnzipNSY/ process to a block returning a declaration of  the resulting signal. process identifier  input signal output signals output signal types  Translate a UnzipxSY/ process to a block returning a declaration of  the resulting signal. process identifier  input signal output signals type of vector elements  vector Size  Translate a DelaySY/ process to a block returning a declaration of  the resulting signal. process identifier  input signal AST of the initial value  of the delay process output signal =Translate a System instance into a VHDL component instantion 2 returning the declartion of the output signals parent system logic instance identifier input signals output signals parent system identifier parent input identifiers parent output identifiers 5Translate a VHDL Signal to a VHDL Signal declaration  Signal name !Type of the intermediate signal /Maybe an initializer expression for the signal JTranslate a VHDL identifier and a type to an interface signal declaration 8Translate a Port to a VHDL Interface signal declaration /Translate a local TH name to a VHDL Identifier 3Translate a system identifier to a VHDL identifier 4Translate a process identifier to a VHDL identifier 1translate a port identifier to a VHDL Identifier  translate a  to a VHDL y  We don'7t distinguish between a type and its version nested in   & since it makes no difference in VHDL  Translate a custom  to a VHDL y !;Really do the translation (customTR2TM deals with caching) "FSVec? ? FSVecs are translated to subtypes of unconstrained vectors. = All FSVec operations are translated as operations for the  unconstrained type. 1Transform an enumerated Algebraic type to a VHDL > TypeMark adding its default function to the global results Enumerated type definition #&Translation table for primitive types $Throw a function error %'Translate a typed function AST to VHDL  input ast HFunction, Function name, name of inputs, type of inputs, return type &JTranslate a typed function AST to VHDL (only returning the functions body '@Translate a list of declarations to a list of process function  ASTs (>Tranlate a list of declarations and add them to the auxiliary 2 declarations in the function translation state )GCheck if a process function AST fulfils the VHDL backend restrictions. J It returs the function TH-name its input paterns, its body expression, : and the list of theclarations in the where construct. *JGet the spec of a VHDL function from the Haskell function name, its type N and its input patterns. This function also takes care of initalizing the  translation namespace. Ftranslated function spec, function name, inpt parameters, input types  and return types Function name Function type input patterns +)Translate an input pattern to a VHDLID, = making the necessary changes in the translation namespace ,7prepare the translation namespace for an input pattern name prefix obtained so far  pattern -Throw an expression error .<Create the unique statement of a VHDL from a TH expression. /2Translate a case alternative from Haskell to VHDL 04Translate a Haskell expression to a VHDL expression 1Translate an integer to VHDL 2345% !"#$%&'()*+,-./012345% !"#$%&'()*+,-./012345Gportable experimentalforsyde-dev@ict.kth.se6:Parse the output of the testbench (a tab separated files) 7 into strings denoting the individual output signals +String containing the complete output file output signal values in form  of strings 71write a test bench, using a clock cycle of 10 ns , (Note: the initial and final CWD will be / ) Number of cycles to simulate  if  the number will be determined ( by the length of the input stimulti. + Useful when the system to simulate doesn't + have inputs or the inputs provided are  infinite $Input stimuli (one list per signal) Number of cycles simulated 8Generate the Context Clause Main system Id 9,Generates an empty entity fot the testbench Main system Id :generate the architecture Maximum number of cycles Input stimuli Number of cycles simulated ;/generate the assignments for the input stimuli Maximum number of cycles Input stimuli Input signal ids (Assignments,  number of cycles  simulated) ' if the number of input signas is zero <0generates a clock process with a period of 10ns =generate the output process output signals 6767Hportable experimentalforsyde-dev@ict.kth.se >2Generate a testbench and execute it with Modelsim , (Note: the initial and final CWD will be / ) 'Number of cycles to simulate !input stimuli, each signal value & is expressed as a template haskell  expression results, each signal value  is expressed as a string ?.Compile the generated VHDL code with Modelsim , (Note: the initial and final CWD will be  systemNamevhdl ) @ Run vlib  arguments A Run vmap  arguments B Run vmap  arguments C Run vsim  arguments Drun a ModelSim command Command to execute Command arguments EBRun a process, previously announcing a message and waiting for it  to finnish its execution. message to show command to execute command arguments #Did the execution end succesfully? FGshort-circuit and for monads >?>?Iportable experimentalforsyde-dev@ict.kth.seHInternal VHDL-Monad version of ForSyDe.Backend.writeVHDL , (Note: the initial and final CWD will be / ) ICWrite the global traversing results (i.e. the library design file) * accumulated in the state of the monad JLTraverse the netlist and write the local results (i.e. system design files) K.Traverse the netlist of a System Definition, > returning the (implicit) final traversing state and a list  containing the d of each output of the system L'new'* traversing function for the VHDL backend M'define'* traversing function for the VHDL backend Yd !"#$%&'()efghijklmnopqrstuvwxyz{|}~*+HHportable experimentalforsyde-dev@ict.kth.se~IGiven a System Definition whose name is a valid VHDL _basic_ identifier  (call it "A" ) generate A.vhd% in current working directory using  default compilation options. N Imp: the input and output signal names of A must be valid VHDL identifiers - (basic or extended) and different to clk and reset @ which are reserved for the main clock and reset signals ~<-alternative which allows setting VHDL compilation options. IGenerate a function which, given a system definition and some simulation  stimuli: $ Writes a VHDL model of the system L Simulates the VHDL model with Modelsim getting the results back to Haskell Number of cycles to simulate  if  the number will be determined ( by the length of the input stimulti. + Useful when the system to simulate doesn't + have inputs or the inputs provided are  infinite system definition to simulate %$-alternative of  , note that 2 compileModelSim will implicitly be set to True  !"#$%&'()*+~~$%&'()*!#" +~Jportable experimentalforsyde-dev@ict.kth.se+ !"#$%&'()*+,-./0123456789~Kportable experimentalforsyde-dev@ict.kth.se      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~NLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                       ! " #$%&'()*+,-./0123456789:;<=>?@ABCDEF.GpqHIJ9KLMN5O5P5Q5R67S7T7U9V9W9X;YZ<[<\<]<^<_<_<`<a<b<c<d<e<f<g<h<i<j<j<k<l<m<n<o<p@q@r@s@t@u@v@w@w@x@y@z@{|}~    !""""""""""""""""""####$$$$$$$$$$$$%%&&&&&&&&&&&&&&&&&&&&&&&''''''''''(                         !"#$%&'()*+,-./0123-456-7-7-4-8-9-9-:-;-<-=->-?-@-A-B-CDE-F.G.H.I.I.J/K/K/L/M/N/O/O/P/Q/R/S0TUVWXY0Z00[0\0]0^0_0`0a0`0b0c0d0e0f0g0h0i0j0k0l0m0n0o0p0q0r0s0t0u0v0w0x0y0z0{0|0}0~00000000000000000000000000000000000000XXXXXXUUUUUUUUUVUVUVUVUV11111111111111111111111111111111111111111 1 1 1 1 1 1 1 1111111111111111111111111 1!1"1#1$1%1%1&1'1(1)1)1*1*1+1+1,1-1.1/1011121314151516171818191:1;1<1<1=1>1?1@1@1A1A1B1C1D1E1F1F1G1H1I1J1K1L1M1N1O1P1P1Q1Q1R1R1S1T1U1V1W1X1Y1Z1Z1[1\1\1]1^1_1`1a1a1b1b1c1d1d1e1f1g1h1i1i1j1j1k1l1m1n1o1o1p1p1q1r1s1t1u1v1w1x1y1y1z1{1|1}1~11111111111111222222222222222222222222222222222222222222222222222222222222222222222333345555555555555555555O5555556666666666666666666666666666666 6 6 6 6 6677777777777888888 9!9"9#9#9$9K9%9&9'9(9(9)9*9+9"9,9-9.9/90919293945969798999:9;9<99=;>??@ABCDEFG<H<I<I<J<K<L<M<M<N<O<P<P<Q<R<S<T<U<V<W<W<X<Y<Z<[<\<\<]<^<_<`<`<a<b<c<d<e<f<g<h<i<j<k<l<m<n<o<p<q<r<s<t<u<v<w<x<y<z<{<|<}<~<<<==============================>>??????????@H@H@I@M@M@@@@@Q@R@S@@@X@Y@[@@@]@^@@e@f@@@j@k@l@m@@@@@}@~@AAAAAAAAAAABCCCCCDDDDD!!EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFGGGGGGGGHHHHHHHHHHIIII I I  ForSyDe-3.1.1ForSyDe.Shallow.VectorForSyDe.Shallow.DFTForSyDe.Shallow.BitVectorForSyDe.Shallow.PolyArithForSyDe.Shallow.SignalForSyDe.Shallow.AbsentExtForSyDe.Shallow.QueueForSyDe.Shallow.MemoryForSyDe.Shallow.SynchronousLibForSyDe.Shallow.StochasticLib%ForSyDe.Shallow.SynchronousProcessLibForSyDe.Shallow.CTLibForSyDe.Shallow.UntimedLibForSyDe.Shallow.AdaptivityLibForSyDe.Shallow.GaussianForSyDe.Shallow.DataflowLib ForSyDe.Shallow.DomainInterfacesForSyDe.Shallow.FIRForSyDe.Shallow.FilterLibForSyDe.Process ForSyDe.DFT ForSyDe.IdsForSyDe.SystemLanguage.Haskell.TH.Lift!Language.Haskell.TH.LiftInstancesForSyDe.SignalForSyDe.Backend.SimulateForSyDe.Backend.VHDLForSyDe.Backend.GraphML ForSyDe.BitForSyDe.AbsentExtForSyDe.Process.SynchProc ForSyDe.FIRForSyDe.Backend.PprForSyDe.OSharing.UDynamicData.Traversable.GenericZipWithData.Typeable.TypeRepLibLanguage.Haskell.TH.TypeLib Paths_ForSyDeForSyDe.ConfigForSyDe.Shallow.UtilityLibForSyDe.Shallow.CoreLibForSyDe.Shallow.MoCLibForSyDe.ShallowForSyDe.OSharingForSyDe.Process.ProcTypeForSyDe.Process.ProcValForSyDe.ForSyDeErrForSyDe.Backend.VHDL.ASTForSyDe.Backend.VHDL.ConstantsForSyDe.Backend.VHDL.PprForSyDe.Backend.VHDL.FileIOForSyDe.Process.ProcFunForSyDe.NetlistForSyDe.System.SysFunForSyDe.Netlist.TraverseForSyDe.System.SysDefForSyDe.System.SysFun.InstancesForSyDe.System.Instantiate#ForSyDe.Backend.VHDL.Traverse.VHDLMForSyDe.Backend.VHDL.GenerateForSyDe.Backend.VHDL.QuartusForSyDe.Backend.GraphML.AST)ForSyDe.Backend.GraphML.Traverse.GraphMLMForSyDe.Backend.GraphML.PprForSyDe.Backend.GraphML.FileIO ForSyDe.Backend.GraphML.Traverse"ForSyDe.Process.ProcType.Instances$ForSyDe.Backend.VHDL.GlobalNameTableForSyDe.Backend.VHDL.TranslateForSyDe.Backend.VHDL.TestBenchForSyDe.Backend.VHDL.ModelsimForSyDe.Backend.VHDL.TraverseForSyDe.BackendForSyDeVector:>NullVvector fromVectorunitVnullVlengthVreplaceVatVheadVtailVlastVinitVtakeVdropVselectVgroupV<+><:mapVzipWithVfoldlVfoldrVfilterVzipVunzipVshiftlVshiftrVrotrVrotlVconcatVreverseV generateViterateVcopyVdftfftParityOddEven BitVector isBitVectorintToBitVectorbitVectorToIntaddEvenParityBitaddOddParityBit addParityBitremoveParityBit isEvenParity isOddParityPolyPolyPairmulPolydivPolyaddPoly powerPolygetCoef scalePoly addPolyCoef subPolyCoef scalePolyCoefSignal:-NullSsignal fromSignalunitSnullSheadStailSatS!-takeSdropSselectS-:+-+lengthS infiniteScopySfanSwriteSreadSAbstExtPrstAbstabstExt fromAbstExt isPresentisAbsent abstExtFuncpsi FiniteQueueFQQueueQpushQ pushListQpopQqueuepushFQ pushListFQpopFQ finiteQueueAccessWriteReadMemoryMemMemSizeAdrnewMemmemState memOutputmapSY zipWithSY zipWith3SY zipWith4SYmapxSY zipWithxSYdelaySYdelaynSYscanlSYscanl2SYscanl3SYscanldSY scanld2SY scanld3SYmooreSYmoore2SYmoore3SYmealySYmealy2SYmealy3SYfilterSYsourceSYfillSYholdSYwhenSYzipSYzip3SYzip4SYzip5SYzip6SYunzipSYunzip3SYunzip4SYunzip5SYunzip6SYzipxSYunzipxSYfstSYsndSYselMapSY selScanlSY selMooreSY selMealySYsigmaUnsigmaGe fifoDelaySYfiniteFifoDelaySYmemorySYmergeSYgroupSY counterSYDACModeDAholdDAlinearSubsigCTtimeStepcombCTcombCT2delayCTshiftCTinitCTmealyCTmooreCTscaleCTaddCTmultCTabsCTsineWaveconstCTzeroCT d2aConverter a2dConverterapplyF1applyF2applyG1cutEqtakeCTdropCTduration startTime showPartsplotplotCTplotCT'vcdGencombUcomb2Ucomb2UCmapUscanUmooreUmealyUzipUzipUszipWithU zipWith3U zipWith4UunzipUsourceUsinkUinitUapplyfSY applyf2SY applyf3SYapplyfUpGaussianNoise FiringTokenValueWildmapDF zipWithDF zipWith3DFscanlDFmooreDFmealyDFdownDIupDI par2ser2DI par2ser3DI par2ser4DI ser2par2DI ser2par3DI ser2par4DI par2serxDI ser2parxDIfirSY SolverModeRK4S2Z firFilter arFilterTrimarmaFilterTrim sLinearFilter zLinearFilters2zCoef h2ARMACoefProcTypeSysIdPortIdProcIdSysDef deriveLift1 deriveLiftmetaLiftProcFun defArgValdefArgPF newProcFunSysFunToIOSimFunSysFunToSimFunSysFun newSysDef newSysDefTHnewSysDefTHName instantiatesimulate QuartusActionFullCompilationAnalysisAndSynthesisAnalysisAndElaboration QuartusOpsactionfMaxfpgaFamiliyDevice pinAssigsVHDLRecursivityVHDLNonRecursive VHDLRecursiveVHDLDebugLevel VHDLVerbose VHDLNormalVHDLOps debugVHDLrecursivityVHDL execQuartuscompileModelsimcheckSynthesisQuartusdefaultVHDLOpsGraphMLRecursivityGraphMLNonRecursiveGraphMLRecursiveGraphMLDebugLevelGraphMLVerbose GraphMLNormal GraphMLOps debugGraphMLrecursivityGraphML yFilesMarkupdefaultGraphMLOps writeGraphMLwriteGraphMLOpsBitLHnot bitToBool boolToBit toBitVector8fromBitVector8 toBitVector16fromBitVector16 toBitVector32fromBitVector32 toBitVector64fromBitVector64unsafeFromAbstExtconstSY zipWith5SY zipWith6SYfir writeVHDL writeVHDLOpswriteAndModelsimVHDLwriteAndModelsimVHDLOpsPprOpspprOpsPprpprdotvSpace multiVSpaceppr_list pprOps_listvNSpacesvSemivCommahCommacommaSep$++$<++>parensNonEmptyparensIfUDynamic unsafeToUDynunsafeFromUDynZipMZipStatefNamelistpop supplySecondzipWithTFError zipWithTFzipTF zipWithTFM zipWithTFAunArrowTbase Data.TypeableTypeRep arrowTyConContexttemplate-haskellLanguage.Haskell.TH.SyntaxForallT mkContext monoContextisPolycontextVarNamescontextConstraints mkForallTType unArrowT'unAppTunAppT'-->reAppTreArrowTArrowT type2TypeRep Data.MaybeNothing dynTHTypethTypeOf typeRep2Type tyCon2TypeTyCon tyConStr2TypestrCon typeableConversionbindirlibdirdatadir libexecdir getBinDir getLibDir getDataDir getLibexecDirgetDataFileName maxTupleSizeGHC.ReadGHC.ShowShow readsVector readsValuesghc-primGHC.BoolTrue fullcirclekVectorbigXbigWevensoddsintToBitVector'bitVectorToInt'isParityCorrect evenNumberxor zipWithExtGHC.ListzipWith readsSignal showsAbstExt readsAbstExt $fShowAbstExtwriteMemreadMemselect1select2 fifoState fifoOutput fifoStateFQ fifoOutputFQrevisionconstRationalFlinearRationalF durationSS takeSubSig dropSubSigsample sampleSubsigmkDir prepSigValues distLabels getLabels vcdHeader valueDumptimeunit findTimescale zipWithUCtakeLuniform pUnitNormXY svGeneratorprefixDF consumeDF consume2DF consume3DFmatchDFmatch2DFmatch3DF matchStDF matchStateselectDFgroup2SYgroup3SYgroup4SY filterAbstDIgroupsipoSY innerProdSYrk4FilterDigitalffn'ffnff1rks4InSYrks4map'iprodrepeatN fixedList URefTableSTGHC.STST URefTableIO URefTableTagURefnewURefreadURefnewURefTableIOqueryIO addEntryIOnewURefTableSTqueryST addEntrySTmemoURef memoURefIO GHC.TypesIO memoURefSTgetEnums readProcType EnumAlgTygenTupInstances ProcValASTexpValexpTypexpEnumsProcValdynvalAST mkProcVal mkProcValASTEProne mtl-1.1.1.0Control.Monad.Error.Class MonadErrorGHC.BaseMonadLocProcValCProcFunCProcCSysDefCEmptyC ContextErr ForSyDeErr VHDLExpErr UnsupportedRecord SignatureListArithSeqListComprehensionDoCase ConditionalLambdaAbstractionSectionUnsupportedLiteralUnkownIdentifierCurryUnsupportedUnsupportedCasePatCaseGuardedBody VHDLFunErr GeneralErrFunGuardedBodyMultipleClausesUnsupportedFunPat InsParamNumUnsupportedDecBlockPolyDecOtherModelsimFailed QuartusFailedUnsupportedProc ReservedIdUnsupportedTypeUntranslatableVHDLExpUntranslatableVHDLFun IncVHDLExtId IncVHDLBasId EmptyVHDLIdInLengthMisMatch SigMisMatch DynMisMatchInconsSysDefPort InconsOutTagIncorrProcFunDecs NonSysDef SubSysIdClash MultProcId MultPortIdOutIfaceLength InIfaceLength IncomSysF NonVarNameEvalErrInconsistentContextsshowIfaceLengthsetProcC setProcFunC setProcValCuErrorintError liftEitherqErrorqGiveUp qPutTraceMsg Debug.Trace putTraceMsg printErrorprintVHDLErrorprintGraphMLError$fErrorForSyDeErr$fShowForSyDeErrfail>>=>>returnControl.Monad.FixmfixFunctorMonadFix Control.Monad MonadPlus traceShowtrace Data.FunctionfixapliftM5liftM4liftM3liftM2liftMunlesswhen replicateM_ replicateMfoldM_foldM zipWithM_zipWithM mapAndUnzipMjoinforever<=<>=>msumforM_forMfilterMguardmapM_mapM sequence_sequence=<<mplusmzerofmapControl.Monad.Error mapErrorT runErrorTErrorTControl.Monad.Translift MonadTransliftIOMonadIOstrMsgnoMsgError catchError throwErrorFCallLiteral ElemAssocExpr Aggregate PrimFCallPrimLitPrimNameNotAbs:**:RemMod:/::*:PosNeg:&::-::+:RorRolSraSlaSrlSll:>=::>::<=::<::/=::=:XnorNorNandXorOrAndInsUnitIUEntityProcSm CompInsSm WformElemWform UnaffectedWhenWhenElse ConWformsConSigAssignSm:<==: ActualDesigOpenADExprADName ActualPart FormalPart AssocElem:=>:Label PMapAspectBlockSmConcSmCSPSmCSISmCSSASmCSBSmSigDecChoiceOthersChoiceE CaseSmAltElseElseIfSeqSmProcCall SigAssignWaitFor:=ForSMReturnSmCaseSmIfSm IfaceVarDec SubProgSpecFunctionVarDecSubProgDecItemSPSBSPVD SubProgBody BlockDecItemBDISDBDISPB AttribName SliceNameSuffixAllSSimplePrefix IndexedName SelectedName:.: SimpleNameVHDLName NAttributeNSliceNIndexed NSelectedNSimple EnumTypeDef ElementDec RecordTypeDef ArrayTypeDef ConsArrayDefUnconsArrayDefTypeDefTDETDRTDATypeDec DiscreteRangeIndexConstraintRangeToRange AttribRange Constraint SubtypeIn SubtypeDecPackageBodyDecItem PackageBodyPackageDecItemPDISSPDISDPDITD PackageDecArchBodyModeOutInTypeMark IfaceSigDec EntityDec LibraryUnit LUPackageBody LUPackageDecLUArchLUEntity ContextItemUseLibrary DesignFileVHDLIdExtendedBasic fromVHDLIdunsafeVHDLBasicIdunsafeVHDLExtId mkVHDLBasicId mkVHDLExtIdunsafeIdAppend specialCharsotherSpecialChars reservedWords logicalPrecrelationalPrec shiftPrecplusPrecsignPrecmultPrecmiscPreccommonContextClauseresetStrclockStrresetIdclockIdtypesIdworkIdstdIdtextioIdrangeIdimageIdeventId defaultIdabsentId presentId fromAbstExtIdunsafeFromAbstExtIdvalueId valueSuffix isPresentId isAbsentIdexIdselIdltplusId plusplusIdemptyIdplusgtId singletonIdlengthIdisnullId replaceIdheadIdlastIdinitIdtailIdtakeIddropIdshiftlIdshiftrIdrotlIdrotrId reverseIdtoBitVector8IdtoBitVector16IdtoBitVector32IdfromBitVector8IdfromBitVector16IdfromBitVector32IdcopyIdshowIdwriteIdoutputId defaultSN std_logicTM booleanTM fsvec_indexTM naturalTMint64TMint32TMint16TMint8TMstringTMtrueExpr falseExprlowExprhighExpr tupStrSuffixtupVHDLIdSuffix tupVHDLSuffixnestValpprExprPrecInfixpprExprPrecPrefix pprExprPrecwriteDesignFilemodNameLiftdoConsTypedProcFunASTtptyptpEnumstpast TypedProcFuntvaltpfloctastDefArgValASTFunAST ProcFunASTnameclsparsvalpflocast procFun2DyncontProcFun2Dyn checkDecsunSignalNlSignalNlTreeNlEdgerootEdge NlNodeOut SysInsOut DelaySYOut UnzipxSYOut UnzipNSYOut ZipWithxSYOut ZipWithNSYOutConstOut InPortOutNlProcSysInsDelaySYUnzipxSYUnzipNSY ZipWithxSY ZipWithNSYConstNlNodeProcInPortNetlist netlistOutsoutTags nlSignalNlOut newInPort newSysIns newNodeOutSigevalfromTHStrSimFun fromDynSimFun applySysFunfromListSysFunfunOutInstances checkSysFTypecheckSysFOutputscheckSysFOutputsNm isSignalT unsafeFromDyn parseProcTypeTravSESTTravSEIO traverseSEIO traverseSEST traverseST argumentsoIface SysDefVal PrimSysDef unPrimSysDefunSysDefIface CheckSysM CheckState accumSubSys accumProcIds accumLogicsidnetlistsubSyslogicSysLogiciIfaceloc Sequential CombinationalNamenewSysDefEPronecheckSysDefPorts checkSysDefdefineCheckSys newCheckSyssignalTup2ListfindDupgenIfaceinstantiateListWire dependencieskickVar simulateDynrelatedrivelazyloopcheckIns IntSignalInfoGlobalTravResulttypeDecs subtypeDecs subProgBodiesLocalTravResultarchDecsarchSms GlobalVHDLST globalSysDefops globalRes enumTypes typeTabletransUnconsFSVecs LocalVHDLST currSysDefcontext funTransSTlocalRes VHDLTravSTlocalglobalVHDLM FunTransSTfreshNameCount nameTableauxDecsinitFunTransST initLocalST withLocalSTwithInitFunTransSTinitGlobalVHDLSTinitVHDLTravSTemptyLocalTravResultemptyGlobalTravResultdebugMsgisRecursiveSetisCompileModelsimSet setVHDLOps addSigDecaddStmlookupCustomType addEnumTypes getEnumConsId addCustomType addTypeDec addSubtypeDecaddUnconsFSVecaddSubProgBodyaddTransNamePairaddDecsToFunTransSTgenFreshVHDLId liftEProne throwFError withProcC withProcFunC withProcValC genOutAssignsgenSignalAssigngenFCallAssign genExprAssigngenSysDesignFilegenLibDesignFile genAssocElemsgenPMapgenFCall genExprFCall genExprFCallN genExprFCall0genExprFCall0L genExprFCall1genExprFCall1L genExprFCall2genExprFCall2L genExprFCall4genExprFCall4LgenExprProcCallgenExprProcCall0genExprProcCall1genExprProcCall2genExprProcCall4genAssocgenUnconsVectorFuns genTupleFunsgenAbstExtFunsgenEnumAlgFunsapplyRangeAttrib callQuartusgen_quartus_tcl GraphMLNodeOutNodeProcNode GraphMLEdge GraphMLGraph GraphMLNodeId GraphMLPortIdGraphMLGraphIdnodesedgesGlobalGraphMLSTLocalGraphMLST GraphMLTravSTGraphMLMinitGlobalGraphMLSTinitGraphMLTravSTgenyFilesMarkup setGraphMLOpsaddEdgeaddNode YFilesMarkuppprGraphWithHeadersport process_type value_arg procfun_arginstance_parentportSepnodeDimsnIOPorts writeGraph writeGraphMLMwriteLocalGraphMLMtraverseGraphML newGraphML defineGraphMLreallyUnsafeToBitVectorfromBitVectorDef IsConsEnum unIsConsEnum isConsEnum getEnumAlgTysipo innerProdglobalNameTabletransSysDef2EnttransZipWithN2BlocktransZipWithx2BlocktransUnzipNSY2BlocktransUnzipxSY2BlocktransDelay2BlocktransSysIns2CompInstransVHDLName2SigDectransVHDLId2IfaceSigDectransPort2IfaceSigDectransTHName2VHDLtransSysId2VHDLtransProcId2VHDLtransPortId2VHDL transTR2TM customTR2TM doCustomTR2TMenumAlg2TypeDec primTypeTablefunErrtransProcFun2VHDLtransProcFun2VHDLBody decs2ProcFuns transDecscheckProcFunASTtransProcFunSpectransInputPat2VHDLIdpreparePatNameSpaceexpErrtransFunBodyExp2VHDLtransMatch2VHDLCaseSmAlt transExp2VHDLtransInteger2VHDLtransTLNat2InttransInt2TLNat fSVecTyConunAppparseTestBenchOutwriteVHDLTestBenchgenVHDLTestBenchContextgenVHDLTestBenchEntitygenVHDLTestBenchArchgenStimuliAssigns genClkProc genOutputProcexecuteTestBenchModelsimcompileResultsModelsimrun_vlibrun_vmaprun_vcomrun_vsimrunModelsimCommandrunWaitisModelsimInstalled<&&> writeVHDLMwriteGlobalVHDLMwriteLocalVHDLM traverseVHDLMnewVHDL defineVHDL