Skip to content

MXP redesign #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 141 commits into from
Mar 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
11efced
feat: design document for MXP_v3
OlivierBBB Jan 20, 2025
bdb5f0f
ras: forgot the doc ^^
OlivierBBB Jan 20, 2025
6ead4bd
feat: common columns
OlivierBBB Jan 20, 2025
e14815b
feat: perspective macros + ras
OlivierBBB Jan 20, 2025
dce27bd
ras: added missing _all_bla.tex file
OlivierBBB Jan 20, 2025
60d38ed
ras
OlivierBBB Jan 20, 2025
e7db64d
ras: inputs again
OlivierBBB Jan 20, 2025
dc99979
ras
OlivierBBB Jan 20, 2025
a54995a
added instruction decoder columns
lorenzogentile404 Jan 20, 2025
45bbc7d
Merge branch 'MXP-redesign' of github.com:Consensys/linea-specificati…
lorenzogentile404 Jan 20, 2025
2123c74
ras
OlivierBBB Jan 20, 2025
46d1a0e
ras
OlivierBBB Jan 20, 2025
50b2c54
added macro columns
lorenzogentile404 Jan 20, 2025
08d32fe
Merge branch 'MXP-redesign' of github.com:Consensys/linea-specificati…
lorenzogentile404 Jan 20, 2025
ba235bd
added dollar symbol
lorenzogentile404 Jan 20, 2025
fffb56e
ras
OlivierBBB Jan 20, 2025
bb505d5
ras
OlivierBBB Jan 20, 2025
290ad6d
ras
OlivierBBB Jan 21, 2025
e366a7e
feat: details on the computation phase + more SCENARIO's
OlivierBBB Jan 23, 2025
8ee8a4f
feat: binary constraints
OlivierBBB Jan 23, 2025
868cd61
ras
OlivierBBB Jan 23, 2025
91948c7
ras
OlivierBBB Jan 23, 2025
315da79
ras: moved stuff to mxp/constraints/
OlivierBBB Jan 23, 2025
b7eb9b3
added allowed perspective transitions and disallowed
lorenzogentile404 Jan 23, 2025
57c82aa
Merge branch 'MXP-redesign' of github.com:Consensys/linea-specificati…
lorenzogentile404 Jan 23, 2025
4e4fabf
feat: ct_max_sum macro
OlivierBBB Jan 23, 2025
d657ca9
extended heartbeat
lorenzogentile404 Jan 23, 2025
66e1c8d
Merge branch 'MXP-redesign' of github.com:Consensys/linea-specificati…
lorenzogentile404 Jan 23, 2025
a38a3cd
ras
OlivierBBB Jan 23, 2025
3d859b0
ras: offset
OlivierBBB Jan 23, 2025
c0017a5
used macro for max ct
lorenzogentile404 Jan 23, 2025
6ac3333
Merge branch 'MXP-redesign' of github.com:Consensys/linea-specificati…
lorenzogentile404 Jan 23, 2025
5b83148
added counter evolution and finalization constraints to heartbeat
lorenzogentile404 Jan 23, 2025
ac2feef
ras
OlivierBBB Jan 23, 2025
66c97d2
ras
OlivierBBB Jan 23, 2025
725a9bf
re-added counter evolution and finalization constraint
lorenzogentile404 Jan 23, 2025
b331a16
ras: small refactor
OlivierBBB Jan 23, 2025
99eb688
ras
OlivierBBB Jan 23, 2025
1b9450d
ras
OlivierBBB Jan 23, 2025
5fd13a6
introduced calls to external modules
lorenzogentile404 Jan 23, 2025
d1129c6
feat: some tables describing computations
OlivierBBB Jan 23, 2025
c6dd6f0
feat: FIXED_SIZE must be made obsolete
OlivierBBB Jan 23, 2025
bb3c6f4
started defining single max offset word case
lorenzogentile404 Jan 23, 2025
05b9028
feat: some more diagrams planning out stuff
OlivierBBB Jan 24, 2025
152e0f9
ras
OlivierBBB Jan 24, 2025
e2fc04e
feat: remove the FIXED_SIZE_INSTRUCTION scenario column
OlivierBBB Jan 24, 2025
46a73c9
removed references to non-existing files
lorenzogentile404 Jan 24, 2025
30bd1ee
ordered sections
lorenzogentile404 Jan 24, 2025
9911047
used column names in section names of computations for scenarios
lorenzogentile404 Jan 24, 2025
0588916
feat: double_word case
OlivierBBB Jan 24, 2025
6fd2b40
added subset of scenarios shorthands
lorenzogentile404 Jan 24, 2025
21e9c7b
Merge branch 'MXP-redesign' of github.com:Consensys/linea-specificati…
lorenzogentile404 Jan 24, 2025
7bbec91
fixed shorthands and added labels to sections
lorenzogentile404 Jan 24, 2025
31a273d
added draft of MSIZE constraintsa
lorenzogentile404 Jan 24, 2025
c9e5edd
added msize case and skeleton of trivial case
lorenzogentile404 Jan 24, 2025
f0e1f63
feat: some macro generalities
OlivierBBB Jan 24, 2025
f243d5f
added sanity check symbols
lorenzogentile404 Jan 24, 2025
2b7600b
completed trivial case
lorenzogentile404 Jan 24, 2025
f376539
ras
OlivierBBB Jan 24, 2025
d222531
feat: several things
OlivierBBB Jan 24, 2025
e8c7659
ras
OlivierBBB Jan 24, 2025
6f34471
feat: use ISZERO when detecting zeroness of sizes + other stuff
OlivierBBB Jan 24, 2025
29cd9b2
removed outdated text
lorenzogentile404 Jan 24, 2025
ff17bdd
feat: instruction decoder
OlivierBBB Jan 25, 2025
1149e54
added table for non_msize
lorenzogentile404 Jan 27, 2025
7b5df98
added trivial and nontrivial computation
lorenzogentile404 Jan 27, 2025
9d2b747
moved computation for mxpx to nontrivial case
lorenzogentile404 Jan 27, 2025
98a8954
added MXPX case
lorenzogentile404 Jan 27, 2025
1d06fba
added nontrivial case
lorenzogentile404 Jan 27, 2025
ff1cd04
ras: copied the old intro into here
OlivierBBB Jan 28, 2025
bd596ae
Merge branch 'main' into MXP-redesign
lorenzogentile404 Mar 4, 2025
6157431
Merge branch 'MXP-redesign' of github.com:Consensys/linea-specificati…
lorenzogentile404 Mar 4, 2025
1e8effd
added tree to describe scenarios
lorenzogentile404 Mar 5, 2025
519c0b9
added constraints to non trivial non mxpx
lorenzogentile404 Mar 6, 2025
1ffbf1c
added compuation for non_trivial_non_mxpx
lorenzogentile404 Mar 8, 2025
1e90533
Merge branch 'main' into MXP-redesign
lorenzogentile404 Mar 11, 2025
876c66c
Merge branch 'main' into MXP-redesign
lorenzogentile404 Mar 11, 2025
efb46ca
added missing computation row for nontrivial non mxpx
lorenzogentile404 Mar 11, 2025
36c202f
added computation for single max offset and word pricing case and fix…
lorenzogentile404 Mar 11, 2025
e14dae9
added more computation
lorenzogentile404 Mar 12, 2025
288c5c6
feat: more common column descriptions
OlivierBBB Mar 12, 2025
117f674
feat: consistency argument
OlivierBBB Mar 12, 2025
9616b5d
feat: lookups
OlivierBBB Mar 12, 2025
7ef34d3
ras: small stuff and macros
OlivierBBB Mar 12, 2025
88ef67f
feat: transition graph
OlivierBBB Mar 12, 2025
a6551c9
ras
OlivierBBB Mar 12, 2025
e46138d
feat: scenario decision tree
OlivierBBB Mar 13, 2025
5b95424
ras
OlivierBBB Mar 13, 2025
53d47d6
feat: update instruction decoder
OlivierBBB Mar 13, 2025
8f41a7f
ras: new shorthands
OlivierBBB Mar 13, 2025
4826a0f
ras
OlivierBBB Mar 13, 2025
a799d7c
feat: computations section intro + MSIZE constraints
OlivierBBB Mar 13, 2025
2cfe9fd
ras
OlivierBBB Mar 13, 2025
d676ae2
feat: HUB / MXP interface
OlivierBBB Mar 13, 2025
305c239
ras: DECODER perspective col descriptions + SCENARIO shorthands refac…
OlivierBBB Mar 13, 2025
bd31d9f
ras: DECODER diagram includes MXP_FLAG
OlivierBBB Mar 13, 2025
77bf791
ras: some refactoring shorthands + ras
OlivierBBB Mar 13, 2025
c423085
ras
OlivierBBB Mar 13, 2025
0388ba8
ras: refactoring
OlivierBBB Mar 13, 2025
0a0dd2a
ras
OlivierBBB Mar 13, 2025
1a3330e
feat: finishing justifying the SCENARIO in the interesting case
OlivierBBB Mar 13, 2025
777a2b2
ras: reworking intro + other things
OlivierBBB Mar 18, 2025
468518a
wip: lots of stuff
OlivierBBB Mar 19, 2025
92a1be3
wip: more stuff
OlivierBBB Mar 19, 2025
87691d7
ras: small changes
OlivierBBB Mar 19, 2025
ace28ab
wip: stuff ...
OlivierBBB Mar 19, 2025
6cf1de0
ras: some light refactoring
OlivierBBB Mar 19, 2025
a1e6c34
ras: column descriptions
OlivierBBB Mar 19, 2025
0e2f750
ras: fancy headers for lua.tex diagrams
OlivierBBB Mar 19, 2025
87da296
feat: some reworking of stuff
OlivierBBB Mar 19, 2025
0768abb
ras: renamings
OlivierBBB Mar 19, 2025
e350e4b
feat: major SCENARIO changes
OlivierBBB Mar 19, 2025
5803e5c
feat: done with word and byte pricing
OlivierBBB Mar 20, 2025
e3774f3
feat: MACRO column annotations + ras
OlivierBBB Mar 20, 2025
6ef34c9
fix: typo in constraint + ras
OlivierBBB Mar 20, 2025
7c55497
ras: LINEA_MAX_MEMORY_SIZE -> MXPX_THRESHOLD
OlivierBBB Mar 20, 2025
1486be7
ras
OlivierBBB Mar 20, 2025
0f80a0b
ras: section structure refactoring
OlivierBBB Mar 20, 2025
1b9ea1e
ras: remove comments + renaming
OlivierBBB Mar 20, 2025
ce258a0
feat: improve drawings
OlivierBBB Mar 20, 2025
0f67932
feat: review with @Lorenzo + erased a lot of stuff
OlivierBBB Mar 21, 2025
a756e65
ras: renaming
OlivierBBB Mar 22, 2025
df57c66
ras: deletions + removed comments
OlivierBBB Mar 22, 2025
b7f32dc
ras: adding "Lisp TODO" and "Lisp DONE" everywhere
OlivierBBB Mar 22, 2025
61f6aa9
ras
OlivierBBB Mar 22, 2025
34956b8
ras
OlivierBBB Mar 22, 2025
a12e9e4
ras: a few "Lisp TODO's -> Lisp DONE's"
OlivierBBB Mar 22, 2025
065d183
ras: more small changes + renamings
OlivierBBB Mar 22, 2025
6505d0a
ras: a few "Lisp TODO's" -> "Lisp DONE's" + using the right diagram
OlivierBBB Mar 23, 2025
81296b9
feat: DECODER column descriptions + removing IS_CALL from MXP
OlivierBBB Mar 24, 2025
fe00263
Merge branch 'main' into MXP-redesign
OlivierBBB Mar 24, 2025
2bb0780
ras
OlivierBBB Mar 24, 2025
23f9dea
Merge branch 'main' into MXP-redesign
letypequividelespoubelles Mar 25, 2025
e10908e
updtate jetbrain font
letypequividelespoubelles Mar 25, 2025
1e387ab
Fix typo in 'state change'
OlivierBBB Mar 26, 2025
77214bc
Add trash notation to computation flags
OlivierBBB Mar 26, 2025
0ed79e6
Fix inequality function in LaTeX file
OlivierBBB Mar 26, 2025
092e199
Merge branch 'main' into MXP-redesign
OlivierBBB Mar 29, 2025
c894a77
fix: using LEQ rather than LT when establishing smallness of sizes an…
OlivierBBB Mar 29, 2025
5cbe77c
fix: clarification of TRIVIAL & nontrivial scenario remark
OlivierBBB Mar 29, 2025
16fbfdc
Merge branch 'main' into MXP-redesign
OlivierBBB Mar 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ mmio: view-mmio
modexp: view-modexp_data
mmu: view-mmu
mxp: view-mxp
mxp_v3: view-mxp_v3
oob: view-oob
prc: view-prc
rlp_addr: view-rlp_addr
Expand Down Expand Up @@ -64,6 +65,7 @@ rmmio: recompile-mmio
rmodexp: recompile-modexp_data
rmmu: recompile-mmu
rmxp: recompile-mxp
rmxp_v3: recompile-mxp_v3
roob: recompile-oob
rprc: recompile-prc
rrlp_addr: recompile-rlp_addr
Expand Down
39 changes: 39 additions & 0 deletions mxp_v3/_all_mxp_v3.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
\documentclass[fleqn]{article}
\usepackage[dvipsnames]{xcolor}
\usepackage{xkeyval}
\usepackage{../pkg/common}
%\usepackage{../pkg/dark_theme}
\usepackage{../pkg/std}
\usepackage{../pkg/IEEEtrantools}
\usepackage{../pkg/rom}
\usepackage{../pkg/env}
\usepackage{../pkg/euc}
\usepackage{../pkg/ram}
\usepackage{../pkg/wc3}
\usepackage{../pkg/stack}
\usepackage{../pkg/call_stack}
\usepackage{../pkg/access}
\usepackage{../pkg/expansion}
\usepackage{../pkg/thm_env}
\usepackage{../pkg/offset_processor}
\usepackage{../pkg/flags_stamps_selectors}
\usepackage{../pkg/instruction_flags}
\usepackage{../pkg/exceptions}
\usepackage{../pkg/draculatheme}
\usepackage{../pkg/xkeyval_macros/wcp_calls}
\usepackage{../pkg/xkeyval_macros/euc_calls}

\usepackage{../pkg/draculatheme}

\title{Memory expansion module}
\author{Rollup team}
\date{August 2022}

\begin{document}

\maketitle
\tableofcontents

\input{_inputs}

\end{document}
10 changes: 10 additions & 0 deletions mxp_v3/_inputs.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
\input{_local}

\section{Introduction \lispNone{}} \label{mxp: intro} \input{intro}
\section{Instruction decoder \lispNone{}} \label{mxp: instruction decoder} \input{instruction_decoder_representation}
\section{\hubMod{} / \mxpMod{} interface \lispNone{}} \label{mxp: hub mxp interface} \input{hub_mxp_interface}
\section{Columns \lispDone{}} \label{mxp: columns} \input{columns/_inputs}
\section{Generalities \lispDone{}} \label{mxp: generalities} \input{generalities/_inputs}
\section{Computations \lispTodo{}} \label{mxp: computations} \input{computations/_inputs}
\section{Consistency \lispTodo{}} \label{mxp: consistency} \input{consistency/_inputs}
\section{Lookups \lispTodo{}} \label{mxp: lookups} \input{lookups/_inputs}
95 changes: 95 additions & 0 deletions mxp_v3/_local.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
\def\rOne {\redm{1}}
\def\locPerspectiveSum {\col{persp\_sum}}
\def\locWeightSum {\col{persp\_wght\_sum}}
\def\locCtMaxSum {\col{ct\_max\_sum}}
\def\locStampIncrement {\col{stamp\_increment}}
\def\locScenarioSum {\mxpScenarioColumn{scenario\_sum}}
\def\locMxpScenarioNotMsize {\mxpScenarioColumn{not\_msize}}
\def\locMxpScenarioNotMsizeNorTrivial {\mxpScenarioColumn{not\_msize\_nor\_trivial}}
\def\locMxpScenarioStateUpdate {\mxpScenarioColumn{state\_update}}
\def\locMxpScenarioNoStateUpdate {\mxpScenarioColumn{no\_state\_update}}

\def\locCtMaxMsize {\yellowm{1}} \def\locCtMaxMsizeName {\yellowm{{\texttt{CT\_MAX\_MSIZE}}}}
\def\locCtMaxTrivialOperation {\yellowm{2}} \def\locCtMaxTrivialOperationName {\yellowm{{\texttt{CT\_MAX\_TRIV}}}}
\def\locCtMaxMxpx {\yellowm{6}} \def\locCtMaxMxpxName {\yellowm{{\texttt{CT\_MAX\_MXPX}}}}
\def\locCtMaxStateUpdateWordPricing {\yellowm{10}} \def\locCtMaxStateUpdateWordPricingName {\yellowm{{\texttt{CT\_MAX\_UPDT\_W}}}}
\def\locCtMaxStateUpdateBytePricing {\yellowm{11}} \def\locCtMaxStateUpdateBytePricingName {\yellowm{{\texttt{CT\_MAX\_UPDT\_B}}}}
% \def\locCtMaxSingleMaxOffsetAndWordPricing {\yellowm{4}} \def\locCtMaxSingleMaxOffsetAndWordPricingName {\yellowm{{\texttt{ct\_max\_1offw}}}}
% \def\locCtMaxSingleMaxOffsetAndBytePricing {\yellowm{5}} \def\locCtMaxSingleMaxOffsetAndBytePricingName {\yellowm{{\texttt{ct\_max\_1offb}}}}
% \def\locCtMaxDoubleMaxOffsetAndWordPricing {\yellowm{6}} \def\locCtMaxDoubleMaxOffsetAndWordPricingName {\yellowm{{\texttt{ct\_max\_2offw}}}}
% \def\locCtMaxDoubleMaxOffsetAndBytePricing {\yellowm{7}} \def\locCtMaxDoubleMaxOffsetAndBytePricingName {\yellowm{{\texttt{ct\_max\_2offb}}}}

\def\locDecoderToMacroRowOffset {\yellowm{1}} \def\locMacroToDecoderRowOffset {\locDecoderToMacroRowOffset}
\def\locMacroToScenarioRowOffset {\yellowm{1}} \def\locScenarioToMacroRowOffset {\locMacroToScenarioRowOffset}
\def\locDecoderToScenarioRowOffset {\yellowm{2}} \def\locScenarioToDecoderRowOffset {\locDecoderToScenarioRowOffset}

\def\locOffsetOneHi {\col{offset\_1\_hi}}
\def\locOffsetOneLo {\col{offset\_1\_lo}}
\def\locSizeOneHi {\col{size\_1\_hi}}
\def\locSizeOneLo {\col{size\_1\_lo}}

\def\locOffsetTwoHi {\col{offset\_2\_hi}}
\def\locOffsetTwoLo {\col{offset\_2\_lo}}
\def\locSizeTwoHi {\col{size\_2\_hi}}
\def\locSizeTwoLo {\col{size\_2\_lo}}

\def\locSizeOneIsZero {\col{size\_1\_is\_zero}}
\def\locSizeOneIsNonZero {\col{size\_1\_is\_nonzero}}

\def\locSizeTwoIsZero {\col{size\_2\_is\_zero}}
\def\locSizeTwoIsNonZero {\col{size\_2\_is\_nonzero}}

\def\locSizeOneIsSmall {\col{size\_1\_is\_small}}
\def\locSizeOneIsLarge {\col{size\_1\_is\_large}}

\def\locSizeTwoIsSmall {\col{size\_2\_is\_small}}
\def\locSizeTwoIsLarge {\col{size\_2\_is\_large}}

\def\locOffsetOneIsSmall {\col{offset\_1\_is\_small}}
\def\locOffsetOneIsLarge {\col{offset\_1\_is\_large}}

\def\locOffsetTwoIsSmall {\col{offset\_2\_is\_small}}
\def\locOffsetTwoIsLarge {\col{offset\_2\_is\_large}}

\def\locMxpComputationMxpxExpressionOne {\col{mxpx\_expression\_1}}
\def\locMxpComputationMxpxExpressionTwo {\col{mxpx\_expression\_2}}
\def\locMxpComputationMxpxExpression {\col{mxpx\_expression}}

\def\locMaxOffset {\col{max\_offset}}

\def\locMaxOne {\col{max\_1}}
\def\locMaxTwo {\col{max\_2}}
\def\locMaxOffsetOne {\col{max\_offset\_1}}
\def\locMaxOffsetTwo {\col{max\_offset\_2}}

\def\locUseParameterSetOne {\col{use\_params\_1}}
\def\locUseParameterSetTwo {\col{use\_params\_2}}

\def\locDoubleOffsetOpcode {\col{double\_offset}}
\def\locSingleOffsetOpcode {\col{single\_offset}}
\def\locWordPricingOpcode {\col{word\_pricing}}
\def\locBytePricingOpcode {\col{byte\_pricing}}
\def\locNumberOfWords {\col{number\_of\_words}}
\def\locNumberOfBytes {\col{number\_of\_bytes}}
\def\locWordPrice {\col{gas\_per\_word}}
\def\locBytePrice {\col{gas\_per\_byte}}
\def\locExtraWordCost {\col{extra\_word\_cost}}
\def\locExtraByteCost {\col{extra\_byte\_cost}}

\def\locFloor {\col{floor}}
\def\locEypA {\col{EYP\_a}}
\def\locQuadraticPart {\col{quadratic\_part}}
\def\locCmemQuadPart {\col{cmem\_quad\_part}}
\def\locCmemLinrPart {\col{cmem\_linear\_part}}
\def\locUpdateInternalState {\col{update\_internal\_state}}
\def\locWords {\col{words}}

\def\locSizeOne {\col{size\_1}}
\def\locCeil {\col{ceil}}

\def\locCompRequired {\col{comp\_required}}
\def\locComp {\col{comp}}

\def\locMxpxExpressionOne {\col{mxpx\_expression\_1}}
\def\locMxpxExpressionTwo {\col{mxpx\_expression\_2}}
\def\locMxpxExpression {\col{mxpx\_expression}}
5 changes: 5 additions & 0 deletions mxp_v3/columns/_inputs.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
\subsection{Common columns \lispDone{}} \label{mxp: columns: common} \input{columns/common}
\subsection{Instruction decoder columns \lispDone{}} \label{mxp: columns: instruction decoder} \input{columns/decoder}
\subsection{Macro instruction columns \lispDone{}} \label{mxp: columns: macro instruction} \input{columns/macro}
\subsection{Scenario columns \lispDone{}} \label{mxp: columns: scenario} \input{columns/scenario/_inputs}
\subsection{Computation columns \lispDone{}} \label{mxp: columns: computation} \input{columns/computation/_inputs}
27 changes: 27 additions & 0 deletions mxp_v3/columns/common.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
We introduce a stamp column as well as various perspective columns.
We shall also require counter columns.
\begin{enumerate}
\item $\mxpStamp$:
stamp column for the \mxpMod{} module;
\item $\mxpContextNumber$:
stamp-constant column containing the relevant context number;
\item $\isMxpInstructionDecoder$:
binary column;
\item $\isMxpMacro$
binary column;
\item $\isMxpScenario$:
binary column; contains a prediction as to the nature of the operation and the required computations;
\item $\isMxpComputation$:
binary column;
\item $\ct$:
counter column;
\item $\maxCt$:
max counter value;
perspective and scenario dependent.
\end{enumerate}
We introduce the following nomenclature:
rows where
$\isMxpInstructionDecoder \equiv \rOne$ will be called \textbf{decoding-rows},
$\isMxpMacro \equiv \rOne$ will be called \textbf{macro-instruction-rows},
$\isMxpScenario \equiv \rOne$ will be called \textbf{scenario-rows} and
$\isMxpComputation \equiv \rOne$ will be called \textbf{computation-rows}.
2 changes: 2 additions & 0 deletions mxp_v3/columns/computation/_inputs.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
\subsubsection{Computation columns \lispDone{}} \label{mxp: columns: scenario: columns} \input{columns/computation/columns}
\subsubsection{External module calls \lispDone{}} \label{mxp: columns: computations: module calls} \input{columns/computation/calls}
75 changes: 75 additions & 0 deletions mxp_v3/columns/computation/calls.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
We define several simple constraint systems to simplify the writing of constraints.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it make sense to be able to have on the same row a WCP and a EUC call ? It would save up to three rows (nb of EUC calls), and won't make the MXP wider as the computation perspective is not the widest one.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could indeed do this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue for future reference #141

\[
\left\{ \begin{array}{lcl}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\wcpCallToLt {
anchorRow = i ,
relOffset = \relof ,
argOneHi = \col{a\_hi} ,
argOneLo = \col{a\_lo} ,
argTwoHi = \col{b\_hi} ,
argTwoLo = \col{b\_lo} ,
} & \define &
\left\{ \begin{array}{lcl}
\mxpComputationWcpFlag _{i + \relof} & = & \rOne \\
\mxpComputationExoInst _{i + \relof} & = & \inst{LT} \\
\mxpComputationArgOneHi _{i + \relof} & = & \col{a\_hi} \\
\mxpComputationArgOneLo _{i + \relof} & = & \col{a\_lo} \\
\mxpComputationArgTwoHi _{i + \relof} & = & \col{b\_hi} \\
\mxpComputationArgTwoLo _{i + \relof} & = & \col{b\_lo} \\
\end{array} \right. \vspace{2mm} \\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\wcpCallToLeq {
anchorRow = i ,
relOffset = \relof ,
argOneHi = \col{a\_hi} ,
argOneLo = \col{a\_lo} ,
argTwoHi = \col{b\_hi} ,
argTwoLo = \col{b\_lo} ,
} & \define &
\left\{ \begin{array}{lcl}
\mxpComputationWcpFlag _{i + \relof} & = & \rOne \\
\mxpComputationExoInst _{i + \relof} & = & \inst{LEQ} \\
\mxpComputationArgOneHi _{i + \relof} & = & \col{a\_hi} \\
\mxpComputationArgOneLo _{i + \relof} & = & \col{a\_lo} \\
\mxpComputationArgTwoHi _{i + \relof} & = & \col{b\_hi} \\
\mxpComputationArgTwoLo _{i + \relof} & = & \col{b\_lo} \\
\end{array} \right. \vspace{2mm} \\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\wcpCallToIszero {
anchorRow = i ,
relOffset = \relof ,
argOneHi = \col{a\_hi} ,
argOneLo = \col{a\_lo} ,
} & \define &
\left\{ \begin{array}{lcl}
\mxpComputationWcpFlag _{i + \relof} & = & \rOne \\
\mxpComputationExoInst _{i + \relof} & = & \inst{ISZERO} \\
\mxpComputationArgOneHi _{i + \relof} & = & \col{a\_hi} \\
\mxpComputationArgOneLo _{i + \relof} & = & \col{a\_lo} \\
\mxpComputationArgTwoHi _{i + \relof} & = & 0 \\
\mxpComputationArgTwoLo _{i + \relof} & = & 0 \\
\end{array} \right. \vspace{2mm} \\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\eucCall {
anchorRow = i ,
relOffset = \relof ,
argOne = \col{a} ,
argTwo = \col{b} ,
} & \define &
\left\{ \begin{array}{lcl}
\mxpComputationEucFlag _{i + \relof} & = & \rOne \\
\mxpComputationArgOneLo _{i + \relof} & = & \col{a} \\
\mxpComputationArgTwoLo _{i + \relof} & = & \col{b} \\
\end{array} \right. \\
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \multicolumn{3}{l}{
% \resultMustBeTrue {
% anchorRow = i ,
% relOffset = \relof ,
% } \define \mxpMacroRes _{i + \relof} = \redm{1}
% } \\
\end{array} \right.
\]
\saNote{}
When using these constraints, one must make sure that the row index $i+\relof$ is that of a computation row.
35 changes: 35 additions & 0 deletions mxp_v3/columns/computation/columns.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
The following columns are used in the lookups
$\mxpMod \hookrightarrow \wcpMod$ and
$\mxpMod \hookrightarrow \eucMod$, see
section~(\ref{mxp: lookups: wcp}) and
section~(\ref{mxp: lookups: euc}) respectively.
\begin{enumerate}
\item
$\mxpComputationWcpFlag$:
binary column triggering the lookup to the \wcpMod{} module;
\item
$\mxpComputationEucFlag$:
binary column triggering the lookup to the \eucMod{} module;
\item
$\mxpComputationExoInst$:
instruction column for either lookup;
\end{enumerate}
The following columns are argument and result columns for these lookups
\begin{multicols}{3}
\begin{enumerate}[resume]
\item
$\mxpComputationArgOneHi$
\item
$\mxpComputationArgOneLo$
\item
$\mxpComputationArgTwoHi$
\item
$\mxpComputationArgTwoLo$
\item
$\mxpComputationResA$
\item
$\mxpComputationResB$
\end{enumerate}
\end{multicols}
\saNote{}
Only the lookup to the \eucMod{} module requires two result columns.
36 changes: 36 additions & 0 deletions mxp_v3/columns/decoder.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
\begin{enumerate}
\item $\mxpDecoderInst$:
byte column containing an opcode;
\item $\mxpDecoderIsMsize$:
binary column;
lights up precisely for the \inst{MSIZE} instruction;
\item $\mxpDecoderIsReturn$:
binary column;
lights up precisely for the \inst{RETURN} instruction;
\item $\mxpDecoderIsMcopy$:
binary column;
lights up precisely for the \inst{MCOPY} instruction;
\item $\mxpDecoderIsFixedSizeThirtyTwo$:
binary column;
lights up precisely for \inst{MLOAD} and \inst{MSTORE};
\item $\mxpDecoderIsFixedSizeOne$:
binary column;
lights up precisely for \inst{MSTORE8};
\item $\mxpDecoderIsSingleMaxOffset$:
binary column;
lights up precisely for instructions producing a single ``max offset'' in memory;
\item $\mxpDecoderIsDoubleMaxOffset$:
binary column;
lights up precisely for instructions producing two ``max offsets'' in memory;
these are the \inst{CALL}-type instructions and \inst{MCOPY};
\item $\mxpDecoderIsWordPricing$:
binary column;
lights up precisely for the instructions which feature a linear-in-words extra cost on top of the memory expansion cost proper;
\item $\mxpDecoderIsBytePricing$:
binary column;
lights up precisely for the instructions which feature a linear-in-bytes extra cost on top of the memory expansion cost proper;
\item $\mxpDecoderGWord$:
contains a ``cost per \evm{} word'' applicable to the instruction;
\item $\mxpDecoderGByte$:
contains a ``cost per \evm{} byte'' applicable to the instruction;
\end{enumerate}
Loading