summaryrefslogtreecommitdiff
path: root/src/Language/Fiddle/Ast
diff options
context:
space:
mode:
Diffstat (limited to 'src/Language/Fiddle/Ast')
-rw-r--r--src/Language/Fiddle/Ast/Internal/SyntaxTree.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Language/Fiddle/Ast/Internal/SyntaxTree.hs b/src/Language/Fiddle/Ast/Internal/SyntaxTree.hs
index a4f98e3..0e4894e 100644
--- a/src/Language/Fiddle/Ast/Internal/SyntaxTree.hs
+++ b/src/Language/Fiddle/Ast/Internal/SyntaxTree.hs
@@ -50,6 +50,7 @@ module Language.Fiddle.Ast.Internal.SyntaxTree
EnumBody (..),
EnumConstantDecl (..),
PackageBody (..),
+ RegisterPosition(..),
-- Helper Functions
regSzToBits,
mapDirected,
@@ -507,6 +508,9 @@ data ObjType stage f a where
ObjType stage f a
deriving (Typeable, Generic, Alter, Annotated, Typeable, Walk)
+newtype RegisterPosition = RegisterPosition (Maybe Text)
+ deriving newtype (Eq, Ord, Show, Generic, FromJSON, ToJSON)
+
-- | Represents a declaration inside an object type, such as a register, an
-- assertion, or a substructure.
data ObjTypeDecl stage f a where
@@ -557,6 +561,9 @@ data ObjTypeDecl stage f a where
regIdent :: Guaranteed (stage .>= Qualified) (Identifier f a),
-- | Size of the register.
regSize :: Variant (stage .>= Qualified) RegSz (Expression Bits stage f a),
+ -- | Declared register position. This gets turned into a "skip-to"
+ -- statement during expansion.
+ regPos :: When (stage .< Expanded) RegisterPosition,
-- | Optional register body.
regBody :: Maybe (RegisterBody stage f a),
-- | Annotation for the register declaration.