Add a VHDL typing style (and some other fixes).
authorMatthijs Kooijman <matthijs@stdin.nl>
Mon, 7 Dec 2009 20:05:56 +0000 (21:05 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Mon, 7 Dec 2009 20:05:56 +0000 (21:05 +0100)
This was an attempt to get line numbering on the VHDL files, but
apparently line numbering is broken in MkIV. Oh well, at least it added
a nice box around the VHDL.

Chapters/Prototype.tex
Utils/Lambda.tex

index 101594bf2a9b4aaacbd210c1242fd968ed0f2fa7..7c4d2096f85e7b84fe63865d7d1194759c7734c3 100644 (file)
       \stopdesc
 
       Using this set of types, all types in basic Haskell can be represented.
       \stopdesc
 
       Using this set of types, all types in basic Haskell can be represented.
-      
       \todo{Overview of polymorphism with more examples (or move examples
       \todo{Overview of polymorphism with more examples (or move examples
-      here)}.
+      here)}
         
   \section[sec:prototype:statetype]{State annotations in Haskell}
     As noted in \in{section}[sec:description:stateann], Cλash needs some
         
   \section[sec:prototype:statetype]{State annotations in Haskell}
     As noted in \in{section}[sec:description:stateann], Cλash needs some
       (state) variables} and \emph{substate variables}, which will be
       defined in the rules themselves.
 
       (state) variables} and \emph{substate variables}, which will be
       defined in the rules themselves.
 
+      These rules describe everything that can be done with state
+      variables and state-containing variables. Everything else is
+      invalid.
+
       \startdesc{State variables can appear as an argument.}
         \startlambda
           avg = λi.λspacked. ...
       \startdesc{State variables can appear as an argument.}
         \startlambda
           avg = λi.λspacked. ...
       \stopbuffer 
     
       \placeexample[][ex:AccStateVHDL]{\VHDL\ generated for acc from \in{example}[ex:AvgState]}
       \stopbuffer 
     
       \placeexample[][ex:AccStateVHDL]{\VHDL\ generated for acc from \in{example}[ex:AvgState]}
-          {\typebuffer[AccStateVHDL]}
+          {\typebuffervhdl{AccStateVHDL}}
       \placeexample[][ex:AvgStateVHDL]{\VHDL\ generated for avg from \in{example}[ex:AvgState]}
       \placeexample[][ex:AvgStateVHDL]{\VHDL\ generated for avg from \in{example}[ex:AvgState]}
-          {\typebuffer[AvgStateVHDL]}
+          {\typebuffervhdl{AvgStateVHDL}}
 %    \subsection{Initial state}
 %      How to specify the initial state? Cannot be done inside a hardware
 %      function, since the initial state is its own state argument for the first
 %    \subsection{Initial state}
 %      How to specify the initial state? Cannot be done inside a hardware
 %      function, since the initial state is its own state argument for the first
index da38e3a20bbf9eaf11c78e15ad5776f524e708e7..23b17d1c01688369f18d7780e5029dc0a24e8804 100644 (file)
@@ -79,6 +79,9 @@ draw b;
 % Define \hs
 \definetype[hs][option=HASKELL,style=mono]
 
 % Define \hs
 \definetype[hs][option=HASKELL,style=mono]
 
+% Define \startvhdl \stopvhdl
+\definetyping[vhdl][numbering=line,before={\startboxed},after={\stopboxed}]
+
 % Type the given buffer with the lambda typing style.
 % e.g., \typebufferlam{buffname}
 \define[1]\typebufferlam{
 % Type the given buffer with the lambda typing style.
 % e.g., \typebufferlam{buffname}
 \define[1]\typebufferlam{
@@ -105,6 +108,19 @@ draw b;
   \setuptyping[option=none,style=\tttf,strip=auto]
 }
 
   \setuptyping[option=none,style=\tttf,strip=auto]
 }
 
+% Type the given buffer with the vhdl typing style.
+% e.g., \typebuffervhdl{buffname}
+\define[1]\typebuffervhdl{
+  % We can't use \startvhdl here defined by definetyping[vhdl] above when
+  % typing buffers, so instead we'll redefine the options here.
+  \setuptyping[style=mono,strip=auto,numbering=line]
+  \startboxed
+  \typebuffer[#1]
+  \stopboxed
+  % Reset the typing options
+  \setuptyping[option=none,style=\tttf,strip=auto]
+}
+
 % Display a useMPgraphic in a pretty box
 \define[1]\boxedgraphic{
   \startboxed
 % Display a useMPgraphic in a pretty box
 \define[1]\boxedgraphic{
   \startboxed