summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-04-22 20:49:26 -0400
committerbd <bdunahu@operationnull.com>2025-04-22 20:49:26 -0400
commit95d09e12792cf5ececd32b8dc84f2cd090c496ef (patch)
tree8660a5fba2e60df5d34712383d727ad46809307d /inc
parent1bbc5b157e16dae032b5e44a7dcf009766eb9ca5 (diff)
Remove the accessor object
Diffstat (limited to 'inc')
-rw-r--r--inc/accessor.h35
-rw-r--r--inc/dum.h7
-rw-r--r--inc/id.h6
-rw-r--r--inc/if.h8
-rw-r--r--inc/instrDTO.h1
-rw-r--r--inc/mm.h7
-rw-r--r--inc/stage.h5
-rw-r--r--inc/wb.h7
8 files changed, 5 insertions, 71 deletions
diff --git a/inc/accessor.h b/inc/accessor.h
deleted file mode 100644
index 67a68b9..0000000
--- a/inc/accessor.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// Simulator for the RISC-V[ECTOR] mini-ISA
-// Copyright (C) 2025 Siddarth Suresh
-// Copyright (C) 2025 bdunahu
-
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <https://www.gnu.org/licenses/>.
-
-#ifndef ACCESSOR_H
-#define ACCESSOR_H
-#include <iostream>
-
-enum Accessor {
- IDLE,
- WRITE,
- MEM,
- EXEC,
- DCDE,
- FETCH,
- L1CACHE,
- SIDE,
-};
-
-std::ostream &operator<<(std::ostream &os, Accessor a);
-
-#endif /* ACCESSOR_H_INCLUDED */
diff --git a/inc/dum.h b/inc/dum.h
index 4a3069a..e5ec740 100644
--- a/inc/dum.h
+++ b/inc/dum.h
@@ -27,12 +27,7 @@
class DUM : public Stage
{
public:
- /**
- * Constructor.
- * @param The next stage in the pipeline.
- * @return A newly allocated DUM object.
- */
- DUM(Stage *next);
+ using Stage::Stage;
InstrDTO *advance(Response p) override;
diff --git a/inc/id.h b/inc/id.h
index d6c108a..a10ad49 100644
--- a/inc/id.h
+++ b/inc/id.h
@@ -25,12 +25,8 @@
class ID : public Stage
{
public:
- /**
- * Constructor.
- * @param The next stage in the pipeline.
- * @return A newly allocated ID object.
- */
ID(Stage *next);
+ using Stage::Stage;
using Stage::advance;
/* The following methods are made public so that they may be tested, and are
diff --git a/inc/if.h b/inc/if.h
index b430dbd..c374145 100644
--- a/inc/if.h
+++ b/inc/if.h
@@ -17,7 +17,6 @@
#ifndef IF_H
#define IF_H
-#include "accessor.h"
#include "instrDTO.h"
#include "response.h"
#include "stage.h"
@@ -25,12 +24,7 @@
class IF : public Stage
{
public:
- /**
- * Constructor.
- * @param The next stage in the pipeline.
- * @return A newly allocated IF object.
- */
- IF(Stage *next);
+ using Stage::Stage;
InstrDTO *advance(Response p) override;
diff --git a/inc/instrDTO.h b/inc/instrDTO.h
index d4af389..e6c9852 100644
--- a/inc/instrDTO.h
+++ b/inc/instrDTO.h
@@ -17,7 +17,6 @@
#ifndef INSTRDTO_H
#define INSTRDTO_H
-#include "accessor.h"
#include "instr.h"
#include <functional>
#include <string>
diff --git a/inc/mm.h b/inc/mm.h
index aec1cdd..230b258 100644
--- a/inc/mm.h
+++ b/inc/mm.h
@@ -24,12 +24,7 @@
class MM : public Stage
{
public:
- /**
- * Constructor.
- * @param The next stage in the pipeline.
- * @return A newly allocated MM object.
- */
- MM(Stage *next);
+ using Stage::Stage;
using Stage::advance;
private:
diff --git a/inc/stage.h b/inc/stage.h
index 448c61a..745e0ff 100644
--- a/inc/stage.h
+++ b/inc/stage.h
@@ -17,7 +17,6 @@
#ifndef STAGE_H
#define STAGE_H
-#include "accessor.h"
#include "instrDTO.h"
#include "pipe_spec.h"
#include "response.h"
@@ -112,10 +111,6 @@ class Stage
*/
signed int dereference_register(signed int v);
/**
- * The name of the pipeline stage.
- */
- Accessor id;
- /**
* The shared pool of general-purpose integer registers.
*/
static std::array<signed int, GPR_NUM> gprs;
diff --git a/inc/wb.h b/inc/wb.h
index c3547c3..d3a1b93 100644
--- a/inc/wb.h
+++ b/inc/wb.h
@@ -24,12 +24,7 @@
class WB : public Stage
{
public:
- /**
- * Constructor.
- * @param The next stage in the pipeline.
- * @return A newly allocated WB object.
- */
- WB(Stage *next);
+ using Stage::Stage;
using Stage::advance;
private: