From 433108bb6ad9b4179323c613a12c6ff223f794b6 Mon Sep 17 00:00:00 2001 From: Kia <kia@special-circumstanc.es> Date: Thu, 22 Apr 2021 09:30:10 -0600 Subject: [PATCH] reorder two tables in the documentation --- unoptimized_lr/simple_lr_automaton.py | 42 ++++++++++++++++++--------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/unoptimized_lr/simple_lr_automaton.py b/unoptimized_lr/simple_lr_automaton.py index 28ca4c3..8bb4cc4 100644 --- a/unoptimized_lr/simple_lr_automaton.py +++ b/unoptimized_lr/simple_lr_automaton.py @@ -102,35 +102,32 @@ from functools import reduce # (Parser action: {shift terminal, accept, error, reduce with rule k}) # # +# Reduce rule table: # -# GOTO table: -# -# (current state number, nonterminal created by reduce rule) -# WStates WNonterminal +# (reduce rule number) +# WRules # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> # / \ # /----------------------\ /---------------------\ -# | Parse State Machine | | GOTO Table | +# | Parse State Machine | | Reduce Rule Table | # \----------------------/ \---------------------/ # \ / # <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -# (validity bit, next state number) -# +# (nonterminal created, number of stack items to pop) # # -# Reduce rule table: +# GOTO table: # -# (reduce rule number) -# WRules +# (current state number, nonterminal created by reduce rule) +# WStates WNonterminal # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> # / \ # /----------------------\ /---------------------\ -# | Parse State Machine | | Reduce Rule Table | +# | Parse State Machine | | GOTO Table | # \----------------------/ \---------------------/ # \ / # <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -# (nonterminal created, number of stack items to pop) -# +# (validity bit, next state number) # # # Parse item stack: @@ -216,7 +213,24 @@ class ParametrizationConstants(): self.W_parsetree_index = len(dummy_signal) - +class LR_automaton_internal(Layout): + def __init__(self, *, parameters): + super().__init__([ + # TABLES + ("ShiftReduce_table_bus"), + ("GOTO_table_bus"), + ("Reduce_table_bus"), + + # STACKS + ("parse_stack_bus"), + ("index_stack_bus"), + + # INPUT + ("input_stream"), + # OUTPUTS + ("serialization_bus"), + ("sideband_bus") + ]) class SimpleLRAutomaton(Elaboratable): def __init__(self, *, lr_tables, parameters): -- GitLab