From f4070f77ab5d2e96c4784179feb5680603150791 Mon Sep 17 00:00:00 2001
From: Kia <kia@special-circumstanc.es>
Date: Thu, 22 Apr 2021 09:57:26 -0600
Subject: [PATCH] likewise for the GOTO table's bus Layout

---
 unoptimized_lr/simple_lr_tables.py | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/unoptimized_lr/simple_lr_tables.py b/unoptimized_lr/simple_lr_tables.py
index 7f3b561..14928c1 100644
--- a/unoptimized_lr/simple_lr_tables.py
+++ b/unoptimized_lr/simple_lr_tables.py
@@ -119,7 +119,12 @@ class ShiftReduceTable(Elaboratable):
 
 
 class GOTOTableBusLayout(Layout):
-    def __init__(self, *, row_input_width, column_input_width, output_width):
+    def __init__(self, *, parameters):
+
+        row_input_width    =  parameters.W_state
+        column_input_width =  parameters.W_nonterminal
+        output_width       = (parameters.W_nonterminal + 1)
+
         super().__init__([
             # INPUTS
             ("row_idx",     unsigned(row_input_width)),    # FROM SOURCE
@@ -135,8 +140,8 @@ class GOTOTableBusLayout(Layout):
         ])
 
 class GOTOTableBus(Record):
-    def __init__(self, *, row_input_width, column_input_width, output_width):
-        super().__init__(TableBusLayout(row_input_width=row_input_width, column_input_width=column_input_width, output_width=output_width))
+    def __init__(self, *, parameters):
+        super().__init__(TableBusLayout(parameters=parameters))
 
 class GOTOtable(Elaboratable):
     def __init__(self, *,  lang_params, input_array):
@@ -175,9 +180,7 @@ class GOTOtable(Elaboratable):
 
 
         # Interfaces
-        self.bus = TableBus(row_input_width=lang_params.W_state,
-                            column_input_width=lang_params.W_nonterminal,
-                            output_width=self.table_width)
+        self.bus = TableBus(parameters=lang_params)
 
 
         # Prepare the table for consumption
-- 
GitLab