FP16 DIV seems to be working
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 22 Jul 2019 19:39:49 +0000 (20:39 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 22 Jul 2019 19:39:49 +0000 (20:39 +0100)
src/ieee754/fpcommon/test/fpmux.py
src/ieee754/fpdiv/pipeline.py

index 24bc78248f370e0c77eda82d50822a714b58ecf6..d18438e8c43e163289b0b2eb759ee84101938541 100644 (file)
@@ -168,9 +168,9 @@ def create_random(num_rows, width, single_op=False, n_vals=10):
                 op1 = randint(0, (1<<width)-1)
                 op2 = randint(0, (1<<width)-1)
 
-                op2 = 0x4000
-                op1 = 0x3c00
-                op2 = 0x3e00
+                #op2 = 0x4000
+                #op1 = 0x3c50
+                #op2 = 0x3e00
                 vals.append((op1, op2,))
     return vals
 
index 119db0f57f626438d4100e7a331d13cb125fc6b3..f9ad69e35dbe0431c8d1f8a171b7063f2356f26a 100644 (file)
@@ -81,7 +81,7 @@ class FPDIVBasePipe(ControlBase):
         ControlBase.__init__(self)
 
         pipechain = []
-        max_n_comb_stages = 3  # TODO (depends on how many RS's we want)
+        max_n_comb_stages = 2  # TODO (depends on how many RS's we want)
         # to which the answer: "as few as possible"
         # is required.  too many ReservationStations
         # means "big problems".
@@ -90,6 +90,7 @@ class FPDIVBasePipe(ControlBase):
         # probably related to having to add 4 in FPDivMuxInOut
         radix = pspec.log2_radix
         n_stages = pspec.core_config.n_stages // max_n_comb_stages
+        print ("n_stages", pspec.core_config.n_stages, n_stages)
         stage_idx = 0
 
         for i in range(n_stages):
@@ -163,6 +164,7 @@ class FPDIVMuxInOut(ReservationStations):
         # then there is guard, round and sticky at the LSB end.
         # also: round up to nearest radix
         fmt.m_width = roundup(fmt.m_width + 5, log2_radix)
+        print ("width", fmt.m_width)
 
         cfg = DivPipeCoreConfig(fmt.m_width, fmt.fraction_width, log2_radix)