module CLaSH.Backend where
import Data.HashSet (HashSet)
import Data.Text.Lazy (Text)
import Control.Monad.State (State)
import Text.PrettyPrint.Leijen.Text.Monadic (Doc)
import SrcLoc (SrcSpan)
import CLaSH.Netlist.Types
import CLaSH.Netlist.BlackBox.Types
type ModName = String
class Backend state where
initBackend :: Int -> HdlSyn -> state
primDir :: state -> IO FilePath
name :: state -> String
extension :: state -> String
extractTypes :: state -> HashSet HWType
genHDL :: String -> SrcSpan -> Component -> State state (String, Doc)
mkTyPackage :: String -> [HWType] -> State state [(String, Doc)]
hdlType :: HWType -> State state Doc
hdlTypeErrValue :: HWType -> State state Doc
hdlTypeMark :: HWType -> State state Doc
hdlSig :: Text -> HWType -> State state Doc
genStmt :: Bool -> State state Doc
inst :: Declaration -> State state (Maybe Doc)
expr :: Bool -> Expr -> State state Doc
iwWidth :: State state Int
toBV :: HWType -> Text -> State state Doc
fromBV :: HWType -> Text -> State state Doc
hdlSyn :: State state HdlSyn
mkBasicId :: State state (Identifier -> Identifier)
setModName :: ModName -> state -> state
setSrcSpan :: SrcSpan -> State state ()
getSrcSpan :: State state SrcSpan