implement hardware out-of-order execution
This commit is contained in:
@@ -12,5 +12,8 @@ void assemble(
|
||||
std::vector<DynamicPipeline::Command>& program,
|
||||
std::array<double, DYN_PIPELINE_MEM_SIZE>& memory,
|
||||
int& mem_used);
|
||||
void to_ooe(
|
||||
std::vector<DynamicPipeline::CommandOOE>& p_ooe,
|
||||
std::vector<DynamicPipeline::Command>& p);
|
||||
|
||||
}
|
||||
|
||||
@@ -32,6 +32,21 @@ struct Command
|
||||
}
|
||||
};
|
||||
|
||||
struct CommandOOE
|
||||
{
|
||||
enum CommandType t;
|
||||
uint16_t op1;
|
||||
uint16_t op2;
|
||||
uint16_t res;
|
||||
uint16_t exe;
|
||||
|
||||
CommandOOE(enum CommandType t, uint16_t op1, uint16_t op2, uint16_t res)
|
||||
: t(t), op1(op1), op2(op2), res(res), exe(0)
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
struct MemCell
|
||||
{
|
||||
double v;
|
||||
@@ -59,4 +74,24 @@ public:
|
||||
void run(void);
|
||||
};
|
||||
|
||||
class SystemOOE
|
||||
{
|
||||
private:
|
||||
std::vector<CommandOOE> *program_memory;
|
||||
std::array<MemCell, DYN_PIPELINE_MEM_SIZE> data_memory;
|
||||
std::array<int, DYN_PIPELINE_LAYERS> layer_cmd {-1};
|
||||
unsigned int system_time;
|
||||
|
||||
void print_program_memory(void) const;
|
||||
void print_pipeline(void) const;
|
||||
bool pipeline_empty(void) const;
|
||||
bool next_instruction(void) const;
|
||||
int get_instruction(void) const;
|
||||
void step(void);
|
||||
|
||||
public:
|
||||
void init(const std::vector<CommandOOE> * const prg, const std::array<double, DYN_PIPELINE_MEM_SIZE>& mem, const int init_mem_size);
|
||||
void run(void);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user