1 | #ifdef SYSTEMC |
---|
2 | /* |
---|
3 | * $Id: Execute_loop_Glue_genMealy_gpr_write.cpp 123 2009-06-08 20:43:30Z rosiere $ |
---|
4 | * |
---|
5 | * [ Description ] |
---|
6 | * |
---|
7 | */ |
---|
8 | |
---|
9 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Execute_loop_Glue/include/Execute_loop_Glue.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace core { |
---|
14 | namespace multi_execute_loop { |
---|
15 | namespace execute_loop { |
---|
16 | namespace execute_loop_glue { |
---|
17 | |
---|
18 | |
---|
19 | #undef FUNCTION |
---|
20 | #define FUNCTION "Execute_loop_Glue::genMealy_gpr_write" |
---|
21 | void Execute_loop_Glue::genMealy_gpr_write (void) |
---|
22 | { |
---|
23 | log_begin(Execute_loop_Glue,FUNCTION); |
---|
24 | |
---|
25 | if (PORT_READ(in_NRESET)) |
---|
26 | { |
---|
27 | for (uint32_t i=0; i<_param->_nb_gpr_write; i++) |
---|
28 | { |
---|
29 | Tcontrol_t val = PORT_READ(in_GPR_WRITE_WRITE_UNIT_VAL [i]); |
---|
30 | Tcontrol_t ack = PORT_READ(in_GPR_WRITE_REGISTER_FILE_ACK [i]); |
---|
31 | Tcontext_t ooo_engine_id = (_param->_have_port_ooo_engine_id)?PORT_READ(in_GPR_WRITE_WRITE_UNIT_OOO_ENGINE_ID [i]):0; |
---|
32 | Tgeneral_address_t num_reg = PORT_READ(in_GPR_WRITE_WRITE_UNIT_NUM_REG [i]); |
---|
33 | Tgeneral_data_t data = PORT_READ(in_GPR_WRITE_WRITE_UNIT_DATA [i]); |
---|
34 | |
---|
35 | PORT_WRITE(out_GPR_WRITE_WRITE_UNIT_ACK [i],ack ); |
---|
36 | |
---|
37 | PORT_WRITE(out_GPR_WRITE_REGISTER_FILE_VAL [i],val ); |
---|
38 | if (_param->_have_port_ooo_engine_id) |
---|
39 | PORT_WRITE(out_GPR_WRITE_REGISTER_FILE_OOO_ENGINE_ID [i],ooo_engine_id); |
---|
40 | PORT_WRITE(out_GPR_WRITE_REGISTER_FILE_NUM_REG [i],num_reg ); |
---|
41 | PORT_WRITE(out_GPR_WRITE_REGISTER_FILE_DATA [i],data ); |
---|
42 | |
---|
43 | PORT_WRITE(out_GPR_WRITE_READ_UNIT_VAL [i],val and ack ); // Transaction |
---|
44 | if (_param->_have_port_ooo_engine_id) |
---|
45 | PORT_WRITE(out_GPR_WRITE_READ_UNIT_OOO_ENGINE_ID [i],ooo_engine_id); |
---|
46 | PORT_WRITE(out_GPR_WRITE_READ_UNIT_NUM_REG [i],num_reg ); |
---|
47 | PORT_WRITE(out_GPR_WRITE_READ_UNIT_DATA [i],data ); |
---|
48 | } |
---|
49 | } |
---|
50 | else |
---|
51 | { |
---|
52 | for (uint32_t i=0; i<_param->_nb_gpr_write; i++) |
---|
53 | { |
---|
54 | PORT_WRITE(out_GPR_WRITE_WRITE_UNIT_ACK [i],0); |
---|
55 | PORT_WRITE(out_GPR_WRITE_REGISTER_FILE_VAL [i],0); |
---|
56 | PORT_WRITE(out_GPR_WRITE_READ_UNIT_VAL [i],0); |
---|
57 | } |
---|
58 | } |
---|
59 | |
---|
60 | log_end(Execute_loop_Glue,FUNCTION); |
---|
61 | }; |
---|
62 | |
---|
63 | }; // end namespace execute_loop_glue |
---|
64 | }; // end namespace execute_loop |
---|
65 | }; // end namespace multi_execute_loop |
---|
66 | }; // end namespace core |
---|
67 | |
---|
68 | }; // end namespace behavioural |
---|
69 | }; // end namespace morpheo |
---|
70 | #endif |
---|