diff options
| author | Siddarth Suresh <155843085+SiddarthSuresh98@users.noreply.github.com> | 2025-03-26 22:05:46 -0400 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-26 22:05:46 -0400 | 
| commit | 7abc8926670c1701db8011cacc9c5e2e2ca95be8 (patch) | |
| tree | fd3263d2754d662fdad6d69851f14a84f44db4d1 /tests/controller.cc | |
| parent | 9eeea1ab8bf4eb17e5da46d57a6c1d455a0a262e (diff) | |
| parent | 8d37d15ebd1221e3b1698abb3b051d9d0c044c93 (diff) | |
Merge pull request #36 from bdunahu/bdunahu
Add fetch stage implementation, tests, program loading, DTO object
Base classes plus base tests for Instruction Fetch stage with a default program
Diffstat (limited to 'tests/controller.cc')
| -rw-r--r-- | tests/controller.cc | 16 | 
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/controller.cc b/tests/controller.cc index a1b8123..e3b9f3c 100644 --- a/tests/controller.cc +++ b/tests/controller.cc @@ -1,6 +1,11 @@  #include "controller.h"  #include "cache.h"  #include "dram.h" +#include "ex.h" +#include "id.h" +#include "if.h" +#include "mm.h" +#include "wb.h"  #include <algorithm>  #include <catch2/catch_test_macros.hpp> @@ -10,7 +15,14 @@ class ControllerPipeFixture  	ControllerPipeFixture()  	{  		this->c = new Cache(new Dram(3), 1); -		this->ct = new Controller(this->c, true); + +		IF *f = new IF(nullptr); +		ID *d = new ID(f); +		EX *e = new EX(d); +		MM *m = new MM(e); +		WB *w = new WB(m); + +		this->ct = new Controller(w, this->c, true);  	}  	~ControllerPipeFixture()  	{ @@ -31,7 +43,7 @@ TEST_CASE_METHOD(  	gprs = this->ct->get_gprs(); -	CHECK(this->ct->get_clock_cycle() == 0); +	CHECK(this->ct->get_clock_cycle() == 1);  	CHECK(std::all_of(  		gprs.begin(), gprs.end(), [](int value) { return value == 0; }));  	// change me later  | 
