kansas-lava- Kansas Lava is a hardware simulator and VHDL generator.

Safe HaskellNone




This module contains functions for generating VCD debug traces. It also provides functionality for (de)serializing Traces.



newtype VCD Source #

VCD is a primary bit-wise record of an interactive session with some circuit Map from module/name to stream.


VCD [(String, VC)] 


Eq VCD Source # 


(==) :: VCD -> VCD -> Bool #

(/=) :: VCD -> VCD -> Bool #

Show VCD Source # 


showsPrec :: Int -> VCD -> ShowS #

show :: VCD -> String #

showList :: [VCD] -> ShowS #

writeVCDFile Source #


:: Bool

Whether to include the clock signal in the list of signals

-> Integer

Timescale in nanoseconds

-> FilePath

name of VCD file

-> VCD 
-> IO () 

Convert a VCD to a VCD file.

readVCDFile :: FilePath -> Signature -> IO VCD Source #

Convert a VCD file to a VCD object.

addEvent :: forall w. Rep w => String -> Int -> X w -> VCD -> VCD Source #

Generate a Signature from a VCD trace

toSignature :: VCD -> Signature Source #

Generate a signature from a trace. TODO: support generics in both these functions?

fromSignature :: Signature -> VCD Source #

Creates an (empty) trace from a signature

Compare two VCDs

cmpVCD :: VCD -> VCD -> Bool Source #

Compare two trace objects. First argument is the golden value. See notes for cmpRepValue

Make a VCD trace from a Fabric and input Pads

mkVCD Source #


:: Int

number of cycles to capture

-> Fabric ()

The Fabric we are tracing

-> [(String, Pad)]

Inputs to the Fabric

-> IO VCD 

Make a VCD from a Fabric and its input.

mkVCDCM Source #


:: Int

number of cycles to capture

-> Fabric ()

Fabric we are tracing

-> [(String, Pad)]

Inputs to the Fabric

-> (KLEG -> IO KLEG)


-> IO (VCD, KLEG) 

Version of mkVCD that accepts arbitrary circuit mods.

Reading and Writing the Test Bench Format (.tbf)

readTBF :: [String] -> Signature -> VCD Source #

Inverse of showTBF, needs a signature for the shape of the desired VCD. Creates a VCD from testbench signal files.

writeTBF :: String -> VCD -> IO () Source #

Convert the inputs and outputs of a VCD to the textual format expected by a testbench.

Convert Rep to Test Bench Word

tbw2rep :: String -> RepValue Source #

Convert string representation used in testbench files to a RepValue Note the reverse here is crucial due to way vhdl indexes stuff

rep2tbw :: RepValue -> String Source #

Convert a RepValue to the string representation used in testbench files