From 62cf6457bad0098c8601354a50664753a12eff06 Mon Sep 17 00:00:00 2001 From: Michael Nolan Date: Sat, 16 May 2020 11:19:21 -0400 Subject: [PATCH] Consolidate every pipe_data to use alu's integer data --- src/soc/alu/pipe_data.py | 3 +++ src/soc/branch/pipe_data.py | 13 +------------ src/soc/cr/pipe_data.py | 14 +------------- src/soc/logical/pipe_data.py | 14 +------------- src/soc/shift_rot/pipe_data.py | 14 +------------- 5 files changed, 7 insertions(+), 51 deletions(-) diff --git a/src/soc/alu/pipe_data.py b/src/soc/alu/pipe_data.py index 13be9747..c386397a 100644 --- a/src/soc/alu/pipe_data.py +++ b/src/soc/alu/pipe_data.py @@ -16,6 +16,9 @@ class IntegerData: def eq(self, i): return [self.ctx.eq(i.ctx)] + def ports(self): + return self.ctx.ports() + class ALUInputData(IntegerData): def __init__(self, pspec): diff --git a/src/soc/branch/pipe_data.py b/src/soc/branch/pipe_data.py index 3d3b9afb..351ca5ec 100644 --- a/src/soc/branch/pipe_data.py +++ b/src/soc/branch/pipe_data.py @@ -32,20 +32,9 @@ from nmigen import Signal, Const from ieee754.fpcommon.getop import FPPipeContext from soc.decoder.power_decoder2 import Data +from soc.alu.pipe_data import IntegerData -class IntegerData: - - def __init__(self, pspec): - self.ctx = FPPipeContext(pspec) - self.muxid = self.ctx.muxid - - def __iter__(self): - yield from self.ctx - - def eq(self, i): - return [self.ctx.eq(i.ctx)] - class BranchInputData(IntegerData): def __init__(self, pspec): super().__init__(pspec) diff --git a/src/soc/cr/pipe_data.py b/src/soc/cr/pipe_data.py index bb248c23..d56c8f3f 100644 --- a/src/soc/cr/pipe_data.py +++ b/src/soc/cr/pipe_data.py @@ -1,18 +1,6 @@ from nmigen import Signal, Const from ieee754.fpcommon.getop import FPPipeContext - - -class IntegerData: - - def __init__(self, pspec): - self.ctx = FPPipeContext(pspec) - self.muxid = self.ctx.muxid - - def __iter__(self): - yield from self.ctx - - def eq(self, i): - return [self.ctx.eq(i.ctx)] +from soc.alu.pipe_data import IntegerData class CRInputData(IntegerData): diff --git a/src/soc/logical/pipe_data.py b/src/soc/logical/pipe_data.py index 34d9c0ae..4bf064fe 100644 --- a/src/soc/logical/pipe_data.py +++ b/src/soc/logical/pipe_data.py @@ -1,18 +1,6 @@ from nmigen import Signal, Const from ieee754.fpcommon.getop import FPPipeContext - - -class IntegerData: - - def __init__(self, pspec): - self.ctx = FPPipeContext(pspec) - self.muxid = self.ctx.muxid - - def __iter__(self): - yield from self.ctx - - def eq(self, i): - return [self.ctx.eq(i.ctx)] +from soc.alu.pipe_data import IntegerData class ALUInputData(IntegerData): diff --git a/src/soc/shift_rot/pipe_data.py b/src/soc/shift_rot/pipe_data.py index 291ecf0a..7f98d16b 100644 --- a/src/soc/shift_rot/pipe_data.py +++ b/src/soc/shift_rot/pipe_data.py @@ -2,19 +2,7 @@ from nmigen import Signal, Const from nmutil.dynamicpipe import SimpleHandshakeRedir from soc.alu.alu_input_record import CompALUOpSubset from ieee754.fpcommon.getop import FPPipeContext - - -class IntegerData: - - def __init__(self, pspec): - self.ctx = FPPipeContext(pspec) - self.muxid = self.ctx.muxid - - def __iter__(self): - yield from self.ctx - - def eq(self, i): - return [self.ctx.eq(i.ctx)] +from soc.alu.pipe_data import IntegerData class ShiftRotInputData(IntegerData): -- 2.30.2