flp-0.1.0.0: A layout spec language for memory managers implemented in Rust.

Safe HaskellSafe
LanguageHaskell2010

Language.Floorplan.Core.Compiler

Synopsis

Documentation

buildMap :: Demarc -> Map String Demarc Source #

Build the dictionary / map of layer (and field) identifiers to their inner Demarc. Todo: warning when multiple layers have the same name (which one union picks is undefined behavior)

grafting' :: Map String Demarc -> Demarc -> Demarc Source #

Grafting pre-processing pass

checkUniqNames :: [Demarc] -> [String] Source #

This can be done before or after grafting phase. It checks that every Layer and Field has a globally unique name, reporting an error when the name is not unique.

enumBytes :: [FlagID] -> Int Source #

How many bytes are required for an Enum containing the given fields. This computes ceiling(log_2(length(flags)) / 8).

delta_prim :: Primitive -> Int Source #

TODO: parametrized delta_prim for architecture-dependent types

pow :: Int -> Int -> Int Source #

delta_lit :: LitArith -> Int Source #

Computes over arithmetic expressions in terms of literals

delta :: SizeArith -> Int Source #

Computes number of bits

bits2bytesUP :: (Num t, Num p, Ord t) => t -> p Source #

delta_bytes :: SizeArith -> Int Source #

Rounds up SizeArith to the nearest whole byte.