-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Corrected wrong validation of spectre attack
Project accomplished
- Loading branch information
Showing
66 changed files
with
138 additions
and
3,426 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "ROB.h" | ||
#include ".\headers\ROB.h" | ||
|
||
extern config *CPU_cfg; | ||
extern instr_queue *instr_Q; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "clock.h" | ||
#include ".\headers\clock.h" | ||
|
||
extern vector<int*> clk_wait_list; | ||
extern int debug_level; | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#ifndef BRANCH_H | ||
#define BRANCH_H | ||
|
||
typedef struct BTBEntry | ||
{ | ||
int target; | ||
bool predicted; | ||
bool taken; | ||
}BTBEntry; | ||
|
||
typedef struct squash_param | ||
{ | ||
int R_f; //The front pointer of ROB | ||
int R_r; //The rear pointer of ROB | ||
int ROB_i; //The affected ROB index | ||
bool flag = false; //Whether the squash has begun | ||
}squash_param; | ||
|
||
#include "mips.h" | ||
|
||
class BTB | ||
{ | ||
private: | ||
BTBEntry buf[BTB_LEN]; | ||
public: | ||
BTB(); | ||
void addEntry(int _instr_i, int _target); | ||
BTBEntry *getEntry(int instr_i); | ||
}; | ||
|
||
class branchCtrl | ||
{ | ||
private: | ||
int ROB_i; | ||
int target; | ||
public: | ||
pthread_t handle; | ||
int next_vdd; | ||
branchCtrl(); | ||
void to_squash(int _ROB_i); | ||
void to_target(int _target); | ||
int squash_ROB_i(); | ||
void branch_automat(); | ||
}; | ||
|
||
void init_brcUnit(); | ||
|
||
#endif |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "import.h" | ||
#include ".\headers\import.h" | ||
|
||
extern config *CPU_cfg; | ||
extern clk_tick sys_clk; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "memory.h" | ||
#include ".\headers\memory.h" | ||
|
||
extern clk_tick sys_clk; | ||
extern memory main_mem; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "mips.h" | ||
#include ".\headers\mips.h" | ||
|
||
config *CPU_cfg = nullptr; | ||
instr_queue *instr_Q = nullptr; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "output.h" | ||
#include ".\headers\output.h" | ||
|
||
using namespace std; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "registor.h" | ||
#include ".\headers\registor.h" | ||
|
||
extern clk_tick sys_clk; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# of rs Cycles in EX Cycles in Mem # of FUs | ||
Integer adder 2 1 1 | ||
FP adder 3 3 1 | ||
FP multiplier 2 20 1 | ||
Load/store unit 3 1 4 1 | ||
ROB entries = 128 | ||
CDB buffer entries = 1 | ||
R1=10,R2=16,R3=30,F1=111.111,F2=222.222 | ||
Mem[4]=1,Mem[8]=2,Mem[12]=3.4 | ||
|
||
ADD R1,R0,R0 | ||
SD F1, 0(R1) | ||
ADDI R1,R1,4 | ||
BNE R1,R2,-3 | ||
SD F2, 0(R1) | ||
LD F3, 0(R1) | ||
LD F4, -8(R1) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# of rs Cycles in EX Cycles in Mem # of FUs | ||
Integer adder 4 1 1 | ||
FP adder 3 4 1 | ||
FP multiplier 2 15 1 | ||
Load/store unit 10 1 5 1 | ||
ROB entries = 64 | ||
CDB buffer entries = 1 | ||
|
||
R1=12, R2=32, F20=3.0 | ||
Mem[4]=3.0, Mem[8]=2.0, Mem[12]=1.0, Mem[24]=6.0, Mem[28]=5.0, Mem[32]=4.0 | ||
|
||
ld F2, 0(R1) | ||
mult.d F4, F2, F20 | ||
ld F6, 0(R2) | ||
add.d F6, F4, F6 | ||
sd F6, 0(R2) | ||
addi R1, R1, -4 | ||
addi R2, R2, -4 | ||
bne R1, R0, -8 | ||
NOP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# of rs Cycles in EX Cycles in Mem # of FUs | ||
Integer adder 4 1 1 | ||
FP adder 3 4 1 | ||
FP multiplier 2 15 1 | ||
Load/store unit 3 1 5 1 | ||
ROB entries = 64 | ||
CDB buffer entries = 1 | ||
|
||
R0=0 | ||
Mem[4]=3.0 | ||
|
||
Addi R2, R0, -2 | ||
Addi R3, R0, 4 | ||
Addi R2, R2, 2 | ||
Ld F1, 0(R1) | ||
Beq R2, R0, 5 | ||
Addi R3, R3, 4 | ||
Addi R2, R2, 8 | ||
Mult.d F3, F2, F1 | ||
Add R2, R2, R2 | ||
Add R1, R1, R1 | ||
Add R1, R1, R1 | ||
Add R1, R1, R1 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.