Changeset 88 for trunk/IPs/systemC/Environment
- Timestamp:
- Dec 10, 2008, 7:31:39 PM (16 years ago)
- Location:
- trunk/IPs/systemC/Environment
- Files:
-
- 3 added
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/Environment/Cache/Makefile
r81 r88 4 4 5 5 #-----[ Variable ]----------------------------------------- 6 7 ENTITY ?= Cache 6 8 7 9 OBJECTS_DEPS = $(patsubst $(DIR_QUEUE)/$(DIR_SRC)/%.cpp,$(DIR_QUEUE)/$(DIR_OBJ)/%.o,$(wildcard $(DIR_QUEUE)/$(DIR_SRC)/*.cpp)) … … 19 21 $(MAKE) environment_clean; 20 22 23 clean_all : clean 24 21 25 help : 22 26 @$(MAKE) environment_help -
trunk/IPs/systemC/Environment/Common/include/Debug.h
r81 r88 3 3 4 4 #define DEBUG_ENVIRONMENT true 5 #define DEBUG_CACHE false6 #define DEBUG_DATA false7 #define DEBUG_ENDIANNESS false8 #define DEBUG_QUEUE false9 #define DEBUG_RAMLOCK false10 #define DEBUG_SIM2OS false11 #define DEBUG_TTY false5 #define DEBUG_CACHE true 6 #define DEBUG_DATA true 7 #define DEBUG_ENDIANNESS true 8 #define DEBUG_QUEUE true 9 #define DEBUG_RAMLOCK true 10 #define DEBUG_SIM2OS true 11 #define DEBUG_TTY true 12 12 13 #ifdef DEBUG13 // #ifdef DEBUG 14 14 # define _cout(component, str...) \ 15 15 do \ … … 19 19 fprintf(stdout,str); \ 20 20 } \ 21 } while(0) 22 #else 23 # define _cout(component, str...) \ 24 do \ 25 { \ 26 } while(0) 27 #endif 21 } \ 22 while(0) 23 // #else 24 // # define _cout(component, str...) 25 // do 26 // { 27 // } 28 // while(0) 29 // #endif 28 30 29 31 #endif -
trunk/IPs/systemC/Environment/Data/Makefile
r81 r88 4 4 5 5 #-----[ Variable ]----------------------------------------- 6 7 ENTITY ?= Data 6 8 7 9 # OBJECTS_DEPS = $(patsubst $(DIR_ENDIANNESS)/$(DIR_SRC)/%.cpp,$(DIR_ENDIANNESS)/$(DIR_OBJ)/%.o,$(wildcard $(DIR_ENDIANNESS)/$(DIR_SRC)/*.cpp)) … … 21 23 # $(MAKE) --directory=$(DIR_ENDIANNESS) clean; \ 22 24 25 clean_all : clean 26 23 27 help : 24 28 @$(MAKE) environment_help -
trunk/IPs/systemC/Environment/Data/include/Segment.h
r81 r88 39 39 public : void read (uint32_t address, uint32_t size, char * & data_dest); 40 40 public : void write (uint32_t address, uint32_t size, char * & data_src); 41 public : std::string print (uint32_t depth); 41 42 public : friend std::ostream& operator<< (std::ostream& output, Segment & x); 42 43 }; -
trunk/IPs/systemC/Environment/Data/src/Segment_init.cpp
r81 r88 1 1 #include "../include/Segment.h" 2 #include "../../Common/include/Debug.h" 2 3 3 4 namespace environment { … … 22 23 23 24 memcpy(data, ptab, size); 24 25 25 26 free (ptab); 27 28 29 // { 30 // _cout(DATA,"Segment Init\n"); 31 // _cout(DATA," * size : %d\n",size); 32 // _cout(DATA," * size : %d\n",this->size); 33 // _cout(DATA,"%s\n",print(0).c_str()); 34 35 // uint32_t addr = base; 36 // uint32_t step1 = 4; 37 // uint32_t step2 = step1*8; 38 39 // for (int32_t i=0; i<size; ++i) 40 // { 41 // if ((i%step1) == 0) 42 // _cout(DATA," "); 43 // if ((i%step2) ==0) 44 // { 45 // _cout(DATA,"\n%.8x : ",addr); 46 // addr += step2; 47 // } 48 // _cout(DATA,"%.2x",0xff&static_cast<uint32_t>(data[i])); 49 // } 50 // _cout(DATA,"\n"); 51 // } 26 52 27 53 return true; -
trunk/IPs/systemC/Environment/Data/src/Segment_print.cpp
r81 r88 1 1 #include "../include/Segment.h" 2 #include <sstream> 2 3 3 4 namespace environment { 4 5 namespace data { 6 7 std::string Segment::print(uint32_t depth) 8 { 9 std::ostringstream out(""); 10 std::string tab = std::string(depth,'\t'); 11 12 13 out << tab << "Segment \"" << name << "\"" << std::endl 14 << std::hex 15 << tab << " * base : " << std::setw(8) << std::setfill('0') << base << std::endl 16 << tab << " * size : " << std::setw(8) << std::setfill('0') << size << std::endl 17 << std::dec 18 << tab << " * uncached : " << uncached << std::endl 19 << tab << " * type : " << type; 20 21 return out.str(); 22 } 5 23 6 24 std::ostream& operator<< (std::ostream& output, Segment & x) 7 25 { 8 output << "Segment \"" << x.name << "\"" << std::endl 9 << std::hex 10 << " * base : " << std::setw(8) << std::setfill('0') << x.base << std::endl 11 << " * size : " << std::setw(8) << std::setfill('0') << x.size << std::endl 12 << std::dec 13 << " * uncached : " << x.uncached << std::endl 14 << " * type : " << x.type; 26 output << x.print(0); 15 27 16 28 return output; -
trunk/IPs/systemC/Environment/Endianness/Makefile
r81 r88 2 2 3 3 #-----[ Variable ]----------------------------------------- 4 5 ENTITY ?= Endianness 4 6 5 7 #OBJECTS_DEPS = … … 15 17 $(MAKE) environment_clean; 16 18 19 clean_all : clean 20 17 21 help : 18 22 @$(MAKE) environment_help -
trunk/IPs/systemC/Environment/Makefile
r81 r88 1 1 #-----[ Directory ]---------------------------------------- 2 2 3 DIR_CACHE = Cache 4 DIR_DATA = Data 5 DIR_ENDIANNESS = Endianness 6 DIR_QUEUE = Queue 7 DIR_RAMLOCK = RamLock 8 DIR_SIM2OS = Sim2OS 9 DIR_TTY = TTY 3 DIR_LIB = ./lib 4 DIR_CACHE = ./Cache 5 DIR_DATA = ./Data 6 DIR_ENDIANNESS = ./Endianness 7 DIR_QUEUE = ./Queue 8 DIR_RAMLOCK = ./RamLock 9 DIR_SIM2OS = ./Sim2OS 10 DIR_TTY = ./TTY 10 11 11 12 #-----[ Variable ]----------------------------------------- 13 ENTITY ?= Environment 14 15 LIBRARY_NAME = Environment 16 LIBRARY_FILE = $(DIR_LIB)/lib$(LIBRARY_NAME).a 12 17 13 18 OBJECTS_DEPS = $(patsubst $(DIR_CACHE)/$(DIR_SRC)/%.cpp,$(DIR_CACHE)/$(DIR_OBJ)/%.o,$(wildcard $(DIR_CACHE)/$(DIR_SRC)/*.cpp)) \ … … 18 23 $(patsubst $(DIR_RAMLOCK)/$(DIR_SRC)/%.cpp,$(DIR_RAMLOCK)/$(DIR_OBJ)/%.o,$(wildcard $(DIR_RAMLOCK)/$(DIR_SRC)/*.cpp)) \ 19 24 $(patsubst $(DIR_SIM2OS)/$(DIR_SRC)/%.cpp,$(DIR_SIM2OS)/$(DIR_OBJ)/%.o,$(wildcard $(DIR_SIM2OS)/$(DIR_SRC)/*.cpp)) \ 20 $(patsubst $(DIR_TTY)/$(DIR_SRC)/%.cpp,$(DIR_TTY)/$(DIR_OBJ)/%.o,$(wildcard $(DIR_TTY)/$(DIR_SRC)/*.cpp)) 25 $(patsubst $(DIR_TTY)/$(DIR_SRC)/%.cpp,$(DIR_TTY)/$(DIR_OBJ)/%.o,$(wildcard $(DIR_TTY)/$(DIR_SRC)/*.cpp)) 21 26 22 27 23 28 #-----[ Rules ]-------------------------------------------- 24 29 25 all : 30 all : a b c d e f g 26 31 @\ 27 $(MAKE) --directory=$(DIR_CACHE) all; \ 28 $(MAKE) --directory=$(DIR_DATA) all; \ 29 $(MAKE) --directory=$(DIR_ENDIANNESS) all; \ 30 $(MAKE) --directory=$(DIR_QUEUE) all; \ 31 $(MAKE) --directory=$(DIR_RAMLOCK) all; \ 32 $(MAKE) --directory=$(DIR_SIM2OS) all; \ 33 $(MAKE) --directory=$(DIR_TTY) all; \ 34 $(MAKE) all_environment; 32 $(MAKE) all_environment; \ 33 $(MAKE) $(LIBRARY_FILE); 34 35 a : 36 @\ 37 $(MAKE) --directory=$(DIR_CACHE) all; 38 39 b : 40 @\ 41 $(MAKE) --directory=$(DIR_DATA) all; 42 43 c : 44 @\ 45 $(MAKE) --directory=$(DIR_ENDIANNESS) all; 46 47 d : 48 @\ 49 $(MAKE) --directory=$(DIR_QUEUE) all; 50 51 e : 52 @\ 53 $(MAKE) --directory=$(DIR_RAMLOCK) all; 54 55 f : 56 @\ 57 $(MAKE) --directory=$(DIR_SIM2OS) all; 58 59 g : 60 @\ 61 $(MAKE) --directory=$(DIR_TTY) all; 62 63 64 $(LIBRARY_FILE) : $(OBJECTS_DEPS) $(OBJECTS) $(DIR_LIB) 65 @\ 66 $(ECHO) "Archive : $@";\ 67 $(AR) -r $@ $(OBJECTS_DEPS) $(OBJECTS);\ 68 $(RANLIB) $@; 69 70 $(DIR_LIB) : 71 @\ 72 $(ECHO) "Create directory : $@";\ 73 $(MKDIR) $@; 74 75 exe_all : 76 @\ 77 $(MAKE) --directory=$(DIR_CACHE) exe; \ 78 $(MAKE) --directory=$(DIR_DATA) exe; \ 79 $(MAKE) --directory=$(DIR_ENDIANNESS) exe; \ 80 $(MAKE) --directory=$(DIR_QUEUE) exe; \ 81 $(MAKE) --directory=$(DIR_RAMLOCK) exe; \ 82 $(MAKE) --directory=$(DIR_SIM2OS) exe; \ 83 $(MAKE) --directory=$(DIR_TTY) exe; \ 84 $(MAKE) exe; \ 35 85 36 86 clean : … … 46 96 $(RM) tty_*; 47 97 98 clean_all : clean 99 @\ 100 $(RM) $(DIR_LIB); 48 101 49 102 help : -
trunk/IPs/systemC/Environment/Makefile.Environment
r85 r88 1 include $(MORPHEO_TOPLEVEL)/Makefile.tools 2 include $(MORPHEO_TOPLEVEL)/IPs/systemC/processor/Morpheo/Behavioural/Makefile.flags 1 ifeq ($(origin MORPHEO_TOPLEVEL), undefined) 2 $(error "variable MORPHEO_TOPLEVEL is undefined"); 3 else 4 include $(MORPHEO_TOPLEVEL)/Makefile.tools 5 include $(MORPHEO_TOPLEVEL)/Makefile.flags 6 endif 3 7 4 8 #-----[ Directory ]---------------------------------------- 5 DIR_TST = selftest 6 DIR_INC = include 7 DIR_SRC = src 8 DIR_OBJ = obj 9 DIR_BIN = bin 9 ENTITY ?= Environment 10 11 DIR_TMP = $(MORPHEO_TMP)/$(ENTITY) 12 DIR_TST = ./selftest 13 DIR_INC = ./include 14 DIR_SRC = ./src 15 DIR_OBJ = ./obj 16 DIR_BIN = $(DIR_TMP)/bin 10 17 11 18 #-----[ Compilation ]-------------------------------------- … … 16 23 LIBDIR = $(SYSTEMC_LIBDIR_$(SIMULATOR)) 17 24 18 LIBNAME = $(SYSTEMC_LIBNAME_$(SIMULATOR)) \ 19 -lbfd 25 LIBNAME = -lbfd \ 26 -liberty \ 27 $(SYSTEMC_LIBNAME_$(SIMULATOR)) 20 28 21 29 FLAGS = $(SYSTEMC_CFLAGS_$(SIMULATOR)) … … 26 34 27 35 #-----[ Variable ]----------------------------------------- 28 29 ENTITY = `$(BASENAME) $$PWD`30 36 31 37 OBJECTS = $(patsubst $(DIR_SRC)/%.cpp,$(DIR_OBJ)/%.o,$(wildcard $(DIR_SRC)/*.cpp)) \ … … 42 48 #-----[ Rules ]-------------------------------------------- 43 49 50 vpath %.h $(DIR_INC) 51 vpath %.c $(DIR_SRC) 52 vpath %.cpp $(DIR_SRC):$(DIR_TST) 53 vpath %.o $(DIR_OBJ) 54 44 55 .PRECIOUS : $(DIR_OBJ)/%.o $(DIR_BIN)/%.x 45 56 … … 48 59 $(ECHO) "-------------------| $(ENTITY)" 49 60 50 $(DIR_OBJ)/%.o : $(DIR_SRC)/%.cpp $(HEADERS)61 $(DIR_OBJ)/%.o : %.cpp $(HEADERS) 51 62 @\ 52 63 $(ECHO) "Compilation : $*";\ 53 64 $(CXX) $(MORPHEO_CXX_FLAGS) -c -o $@ $<; 54 65 55 $(DIR_OBJ)/%.o : $(DIR_SRC)/%.c $(HEADERS)66 $(DIR_OBJ)/%.o : %.c $(HEADERS) 56 67 @\ 57 68 $(ECHO) "Compilation : $*";\ 58 69 $(CC) $(MORPHEO_CC_FLAGS) -c -o $@ $<; 59 60 $(DIR_OBJ)/%.o : $(DIR_TST)/%.cpp $(HEADERS)61 @\62 $(ECHO) "Compilation : $*";\63 $(CXX) $(MORPHEO_CXX_FLAGS) -c -o $@ $<;64 70 65 71 $(DIR_BIN)/%.x : $(OBJECTS_DEPS) $(OBJECTS) $(OBJECTS_BIN) … … 79 85 80 86 81 exe : all 87 exe : all $(DIR_BIN) 82 88 @\ 83 export SYSTEMC=$(SYSTEMC_$(SIMULATOR)) ; $(EXEC_PREFIX) ./$(EXE) $(SYSTEMC_EXEC_PARAMS_$(SIMULATOR)) 89 $(MAKE) $(EXE); \ 90 export SYSTEMC=$(SYSTEMC_$(SIMULATOR)) ; $(EXEC_PREFIX) $(EXE) $(SYSTEMC_EXEC_PARAMS_$(SIMULATOR)) 84 91 85 92 86 all_environment : test_env $(DIR_OBJ) $(DIR_BIN)93 all_environment : test_env $(DIR_OBJ) 87 94 @\ 88 $(MAKE) $( EXE)95 $(MAKE) $(OBJECTS_DEPS) $(OBJECTS) $(OBJECTS_BIN) 89 96 90 97 environment_clean : … … 104 111 $(ECHO) " -----[ Environment ]------------------------------";\ 105 112 $(ECHO) "";\ 106 $(ECHO) " * test_env : test if environnment's variable is set";\ 107 $(ECHO) " * all_environment : generate object";\ 113 $(ECHO) " * exe : execute testbench";\ 114 $(ECHO) " * test_env : test if environnment's variable is set";\ 115 $(ECHO) " * all_environment : generate object";\ 108 116 $(ECHO) ""; -
trunk/IPs/systemC/Environment/Queue/Makefile
r81 r88 1 #-----[ Variables ]---------------------------------------- 2 3 ENTITY ?= Queue 4 1 5 #-----[ Rules ]-------------------------------------------- 2 6 … … 7 11 @$(MAKE) environment_clean 8 12 13 clean_all : clean 14 9 15 help : 10 16 @$(MAKE) environment_help -
trunk/IPs/systemC/Environment/RamLock/Makefile
r81 r88 1 #-----[ Variables ]---------------------------------------- 2 3 ENTITY ?= RamLock 4 1 5 #-----[ Rules ]-------------------------------------------- 2 6 … … 7 11 @$(MAKE) environment_clean 8 12 13 clean_all : clean 14 9 15 help : 10 16 @$(MAKE) environment_help -
trunk/IPs/systemC/Environment/Sim2OS/Makefile
r81 r88 4 4 5 5 #-----[ Variable ]----------------------------------------- 6 7 ENTITY ?= Sim2OS 6 8 7 9 OBJECTS_DEPS = $(patsubst $(DIR_ENDIANNESS)/$(DIR_SRC)/%.cpp,$(DIR_ENDIANNESS)/$(DIR_OBJ)/%.o,$(wildcard $(DIR_ENDIANNESS)/$(DIR_SRC)/*.cpp)) … … 19 21 $(MAKE) environment_clean 20 22 23 clean_all : clean 24 21 25 help : 22 26 @$(MAKE) environment_help -
trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_convert_address.cpp
r81 r88 9 9 void * Sim2OS::convert_address (void * address) 10 10 { 11 void * result = param->segment_table->getAddrAlloc( (uint32_t)address);11 void * result = param->segment_table->getAddrAlloc(static_cast<uint32_t>(reinterpret_cast<uint64_t>(address))); 12 12 13 13 if (result == NULL) 14 14 { 15 std::cerr << "<" << name << "> address don't match : " << std::hex << (uint32_t)(address) << std::dec << std::endl;15 std::cerr << "<" << name << "> address don't match : " << std::hex << static_cast<uint32_t>(reinterpret_cast<uint64_t>(address)) << std::dec << std::endl; 16 16 exit(0); 17 17 } -
trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_parameter.cpp
r81 r88 13 13 { 14 14 if (num_reg == 0) 15 num_service = int2service( (int)(val));15 num_service = int2service(static_cast<int32_t>(reinterpret_cast<int64_t>(val))); 16 16 else 17 17 arguments[num_reg] = val; -
trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_service_clock.cpp
r81 r88 16 16 17 17 std::cout << "\n\t***** service : clock *****" << std::endl; 18 std::cout << "\tresult : " << (unsigned int) result<< std::endl;19 std::cout << "\terrno : " << (unsigned int) error<< std::endl;18 std::cout << "\tresult : " << static_cast<int32_t>(reinterpret_cast<int64_t>(result)) << std::endl; 19 std::cout << "\terrno : " << error << std::endl; 20 20 21 21 return result; -
trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_service_close.cpp
r81 r88 12 12 } 13 13 14 int fd = (int) arguments[1];14 int fd = static_cast<int>(reinterpret_cast<int64_t>(arguments[1])); 15 15 void * result = (void *) close(fd); 16 16 error = errno; … … 18 18 std::cout << "\n\t***** service : close *****" << std::endl; 19 19 std::cout << "\tfd : " << (unsigned int) fd << std::endl; 20 std::cout << "\tresult : " << (unsigned int) result<< std::endl;20 std::cout << "\tresult : " << static_cast<int32_t>(reinterpret_cast<int64_t>(result)) << std::endl; 21 21 std::cout << "\terrno : " << (unsigned int) error << std::endl; 22 22 -
trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_service_lseek.cpp
r81 r88 12 12 } 13 13 14 int flides = (int) arguments[1];15 off_t offset = (off_t) arguments[2];16 int whence = (int) arguments[3];14 int flides = static_cast<int >(reinterpret_cast<int64_t>(arguments[1])); 15 off_t offset = static_cast<off_t>(reinterpret_cast<int64_t>(arguments[2])); 16 int whence = static_cast<int >(reinterpret_cast<int64_t>(arguments[3])); 17 17 void * result = (void *) lseek(flides,offset,whence); 18 18 error = errno; … … 24 24 std::cout << "\toffset : " << (unsigned int) offset << std::endl; 25 25 std::cout << "\twhence : " << (unsigned int) whence << std::endl; 26 std::cout << "\tresult : " << (unsigned int) result<< std::endl;26 std::cout << "\tresult : " << static_cast<int32_t>(reinterpret_cast<int64_t>(result)) << std::endl; 27 27 std::cout << "\terrno : " << (unsigned int) error << std::endl; 28 28 -
trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_service_open.cpp
r81 r88 13 13 14 14 const char *pathname = (const char *) convert_address(arguments[1]); 15 int flags = (int) arguments[2];16 mode_t mode = (mode_t) arguments[3];15 int flags = static_cast<int >(reinterpret_cast<int64_t>(arguments[2])); 16 mode_t mode = static_cast<mode_t>(reinterpret_cast<int64_t>(arguments[3])); 17 17 void * result = (void *) open(pathname,flags,mode); 18 18 error = errno; … … 26 26 std::cout << "\tmode /10 : " << std::dec << (unsigned int) mode << std::endl; 27 27 std::cout << "\tmode /16 : " << std::hex << (unsigned int) mode << std::endl; 28 std::cout << "\tresult : " << st d::dec << (unsigned int) result<< std::endl;28 std::cout << "\tresult : " << static_cast<int32_t>(reinterpret_cast<int64_t>(result)) << std::endl; 29 29 std::cout << "\terrno : " << (unsigned int) error << std::endl; 30 30 -
trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_service_read.cpp
r81 r88 12 12 } 13 13 14 int fd = (int) arguments[1];14 int fd = static_cast<int>(reinterpret_cast<int64_t>(arguments[1])); 15 15 void * buf = (void *) convert_address(arguments[2]); 16 16 ssize_t count = (ssize_t) arguments[3]; … … 19 19 std::cout << "\n\t***** service : read *****" << std::endl; 20 20 std::cout << "\tfd : " << (unsigned int) fd << std::endl; 21 std::cout << "\tbuf : " << std::hex << (unsigned int) buf<< std::endl;21 std::cout << "\tbuf : " << std::hex << static_cast<int32_t>(reinterpret_cast<int64_t>(buf)) << std::endl; 22 22 //std::cout << "\tbuf : " << std::dec << (char *) buf << std::endl; 23 23 std::cout << "\tcount : " << std::dec << (unsigned int) count << std::endl; 24 std::cout << "\tresult : " << (unsigned int) result<< std::endl;24 std::cout << "\tresult : " << static_cast<int32_t>(reinterpret_cast<int64_t>(result)) << std::endl; 25 25 std::cout << "\terrno : " << (unsigned int) error << std::endl; 26 26 -
trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_service_time.cpp
r81 r88 17 17 18 18 std::cout << "\n\t***** service : time *****" << std::endl; 19 std::cout << "\tt : " << std::hex << (unsigned int) t<< std::endl;20 std::cout << "\tresult : " << std::dec << (unsigned int) result<< " - " << ctime((time_t *) t) << std::endl;19 std::cout << "\tt : " << std::hex << static_cast<int32_t>(reinterpret_cast<int64_t>(t)) << std::endl; 20 std::cout << "\tresult : " << std::dec << static_cast<int32_t>(reinterpret_cast<int64_t>(result)) << " - " << ctime((time_t *) t) << std::endl; 21 21 std::cout << "\terrno : " << (unsigned int) error << std::endl; 22 22 -
trunk/IPs/systemC/Environment/Sim2OS/src/Sim2OS_service_write.cpp
r81 r88 12 12 } 13 13 14 int fd = (int) arguments[1];14 int fd = static_cast<int>(reinterpret_cast<int64_t>(arguments[1])); 15 15 const void *buf = (const void *) convert_address(arguments[2]); 16 16 ssize_t count = (ssize_t) arguments[3]; … … 22 22 std::cout << "\n\t***** service : write *****" << std::endl; 23 23 std::cout << "\tfd : " << (unsigned int) fd << std::endl; 24 std::cout << "\tbuf : " << std::hex << (unsigned int) buf<< std::endl;24 std::cout << "\tbuf : " << std::hex << static_cast<int32_t>(reinterpret_cast<int64_t>(buf)) << std::endl; 25 25 //std::cout << "\tbuf : " << std::dec << (char *) buf << std::endl; 26 26 std::cout << "\tcount : " << std::dec << (unsigned int) count << std::endl; 27 std::cout << "\tresult : " << (unsigned int) result<< std::endl;27 std::cout << "\tresult : " << static_cast<int32_t>(reinterpret_cast<int64_t>(result)) << std::endl; 28 28 std::cout << "\terrno : " << (unsigned int) error << std::endl; 29 29 -
trunk/IPs/systemC/Environment/TTY/Makefile
r81 r88 2 2 3 3 #-----[ Variable ]----------------------------------------- 4 5 ENTITY ?= TTY 4 6 5 7 #OBJECTS_DEPS = … … 16 18 $(RM) tty_*; 17 19 20 clean_all : clean 21 18 22 help : 19 23 @$(MAKE) environment_help -
trunk/IPs/systemC/Environment/include/Cache_Access.h
r81 r88 22 22 }; 23 23 24 Cache_Access ireq_type2cache_type ( Ticache_type_t ireq_type, bool uncached);25 Cache_Access dreq_type2cache_type ( Tdcache_type_t dreq_type, bool uncached);24 Cache_Access ireq_type2cache_type (morpheo::Ticache_type_t ireq_type, bool uncached); 25 Cache_Access dreq_type2cache_type (morpheo::Tdcache_type_t dreq_type, bool uncached); 26 26 }; 27 27 #endif -
trunk/IPs/systemC/Environment/include/Environment.h
r81 r88 20 20 namespace environment { 21 21 22 typedef Respons< Ticache_context_t, Ticache_packet_t,Ticache_error_t> irsp_t;23 typedef Respons< Tdcache_context_t, Tdcache_packet_t,Tdcache_error_t> drsp_t;22 typedef Respons<morpheo::Ticache_context_t, morpheo::Ticache_packet_t,morpheo::Ticache_error_t> irsp_t; 23 typedef Respons<morpheo::Tdcache_context_t, morpheo::Tdcache_packet_t,morpheo::Tdcache_error_t> drsp_t; 24 24 25 25 class Environment : public sc_module … … 29 29 public : sc_in<bool> * NRESET ; 30 30 31 public : sc_in < Tcontrol_t > *** ICACHE_REQ_VAL ;32 public : sc_out< Tcontrol_t > *** ICACHE_REQ_ACK ;33 public : sc_in < Ticache_context_t > *** ICACHE_REQ_CONTEXT_ID ;34 public : sc_in < Ticache_packet_t > *** ICACHE_REQ_PACKET_ID ;35 public : sc_in < Ticache_address_t > *** ICACHE_REQ_ADDRESS ;36 public : sc_in < Ticache_type_t > *** ICACHE_REQ_TYPE ;31 public : sc_in <morpheo::Tcontrol_t > *** ICACHE_REQ_VAL ;//[nb_entity][icache_dedicated_nb_port] 32 public : sc_out<morpheo::Tcontrol_t > *** ICACHE_REQ_ACK ;//[nb_entity][icache_dedicated_nb_port] 33 public : sc_in <morpheo::Ticache_context_t > *** ICACHE_REQ_CONTEXT_ID ;//[nb_entity][icache_dedicated_nb_port] 34 public : sc_in <morpheo::Ticache_packet_t > *** ICACHE_REQ_PACKET_ID ;//[nb_entity][icache_dedicated_nb_port] 35 public : sc_in <morpheo::Ticache_address_t > *** ICACHE_REQ_ADDRESS ;//[nb_entity][icache_dedicated_nb_port] 36 public : sc_in <morpheo::Ticache_type_t > *** ICACHE_REQ_TYPE ;//[nb_entity][icache_dedicated_nb_port] 37 37 38 public : sc_out< Tcontrol_t > *** ICACHE_RSP_VAL ;39 public : sc_in < Tcontrol_t > *** ICACHE_RSP_ACK ;40 public : sc_out< Ticache_context_t > *** ICACHE_RSP_CONTEXT_ID ;41 public : sc_out< Ticache_packet_t > *** ICACHE_RSP_PACKET_ID ;42 public : sc_out< Ticache_instruction_t> **** ICACHE_RSP_INSTRUCTION;//[nb_instruction]43 public : sc_out< Ticache_error_t > *** ICACHE_RSP_ERROR ;38 public : sc_out<morpheo::Tcontrol_t > *** ICACHE_RSP_VAL ;//[nb_entity][icache_dedicated_nb_port] 39 public : sc_in <morpheo::Tcontrol_t > *** ICACHE_RSP_ACK ;//[nb_entity][icache_dedicated_nb_port] 40 public : sc_out<morpheo::Ticache_context_t > *** ICACHE_RSP_CONTEXT_ID ;//[nb_entity][icache_dedicated_nb_port] 41 public : sc_out<morpheo::Ticache_packet_t > *** ICACHE_RSP_PACKET_ID ;//[nb_entity][icache_dedicated_nb_port] 42 public : sc_out<morpheo::Ticache_instruction_t> **** ICACHE_RSP_INSTRUCTION;//[nb_entity][icache_dedicated_nb_port][iaccess_nb_instruction] 43 public : sc_out<morpheo::Ticache_error_t > *** ICACHE_RSP_ERROR ;//[nb_entity][icache_dedicated_nb_port] 44 44 45 public : sc_in < Tcontrol_t > *** DCACHE_REQ_VAL ;46 public : sc_out< Tcontrol_t > *** DCACHE_REQ_ACK ;47 public : sc_in < Tdcache_context_t > *** DCACHE_REQ_CONTEXT_ID ;48 public : sc_in < Tdcache_packet_t > *** DCACHE_REQ_PACKET_ID ;49 public : sc_in < Tdcache_address_t > *** DCACHE_REQ_ADDRESS ;50 public : sc_in < Tdcache_type_t > *** DCACHE_REQ_TYPE ;51 public : sc_in < Tdcache_data_t > *** DCACHE_REQ_WDATA ;45 public : sc_in <morpheo::Tcontrol_t > *** DCACHE_REQ_VAL ;//[nb_entity][dcache_dedicated_nb_port] 46 public : sc_out<morpheo::Tcontrol_t > *** DCACHE_REQ_ACK ;//[nb_entity][dcache_dedicated_nb_port] 47 public : sc_in <morpheo::Tdcache_context_t > *** DCACHE_REQ_CONTEXT_ID ;//[nb_entity][dcache_dedicated_nb_port] 48 public : sc_in <morpheo::Tdcache_packet_t > *** DCACHE_REQ_PACKET_ID ;//[nb_entity][dcache_dedicated_nb_port] 49 public : sc_in <morpheo::Tdcache_address_t > *** DCACHE_REQ_ADDRESS ;//[nb_entity][dcache_dedicated_nb_port] 50 public : sc_in <morpheo::Tdcache_type_t > *** DCACHE_REQ_TYPE ;//[nb_entity][dcache_dedicated_nb_port] 51 public : sc_in <morpheo::Tdcache_data_t > *** DCACHE_REQ_WDATA ;//[nb_entity][dcache_dedicated_nb_port] 52 52 53 public : sc_out< Tcontrol_t > *** DCACHE_RSP_VAL ;54 public : sc_in < Tcontrol_t > *** DCACHE_RSP_ACK ;55 public : sc_out< Tdcache_context_t > *** DCACHE_RSP_CONTEXT_ID ;56 public : sc_out< Tdcache_packet_t > *** DCACHE_RSP_PACKET_ID ;57 public : sc_out< Tdcache_data_t > *** DCACHE_RSP_RDATA ;58 public : sc_out< Tdcache_error_t > *** DCACHE_RSP_ERROR ;53 public : sc_out<morpheo::Tcontrol_t > *** DCACHE_RSP_VAL ;//[nb_entity][dcache_dedicated_nb_port] 54 public : sc_in <morpheo::Tcontrol_t > *** DCACHE_RSP_ACK ;//[nb_entity][dcache_dedicated_nb_port] 55 public : sc_out<morpheo::Tdcache_context_t > *** DCACHE_RSP_CONTEXT_ID ;//[nb_entity][dcache_dedicated_nb_port] 56 public : sc_out<morpheo::Tdcache_packet_t > *** DCACHE_RSP_PACKET_ID ;//[nb_entity][dcache_dedicated_nb_port] 57 public : sc_out<morpheo::Tdcache_data_t > *** DCACHE_RSP_RDATA ;//[nb_entity][dcache_dedicated_nb_port] 58 public : sc_out<morpheo::Tdcache_error_t > *** DCACHE_RSP_ERROR ;//[nb_entity][dcache_dedicated_nb_port] 59 59 60 60 // ===== [ Internal ]==================================================== 61 public : Tcontrol_t ** icache_req_ack ;62 public : Tcontrol_t ** icache_rsp_val ;63 public : Tcontrol_t ** dcache_req_ack ;64 public : Tcontrol_t ** dcache_rsp_val ;61 public : morpheo::Tcontrol_t ** icache_req_ack ; 62 public : morpheo::Tcontrol_t ** icache_rsp_val ; 63 public : morpheo::Tcontrol_t ** dcache_req_ack ; 64 public : morpheo::Tcontrol_t ** dcache_rsp_val ; 65 65 66 66 // ===== [ Variables ]=================================================== … … 68 68 private : Parameters * param; 69 69 70 private: char ** read_iram; 71 private: char ** read_dram; 72 private: char * write_dram; 70 private : char ** read_iram; 71 private : char ** read_dram; 72 private : char * write_dram; 73 74 private : bool * context_stop; // to determine which context have send the signal stop (a same thread can send many signal) 75 private : uint32_t nb_context_stop; // stop the simulation when all context have send the stop signal 76 73 77 74 78 // ===== [ Components ]================================================== … … 88 92 public : ~Environment (void); 89 93 90 public : bool init (std::string section, const char * filename, const char ** list_section); 91 public : void reset (void); 94 public : bool init (std::string section, const char * filename, const char ** list_section); 95 public : void reset (void); 96 public : void stop (uint32_t num_context); 97 public : bool simulation_end (void); 92 98 93 public : void transition (void);94 public : void genMoore (void);99 public : void transition (void); 100 public : void genMoore (void); 95 101 96 102 public : friend std::ostream& operator<< (std::ostream& output, Environment &x); … … 137 143 } 138 144 }; 139 140 141 // private: bool * context_stop; // to determine which context have send the signal stop (a same thread can send many signal)142 // private: uint3 nb_context_stop; // stop the simulation when all context have send the stop signal143 144 // //---------------------------------------------------------------------------------------------145 // //-----[ stop ]--------------------------------------------------------------------------------146 // //---------------------------------------------------------------------------------------------147 // public : bool stop ()148 // {149 // return (nb_context_stop >= nb_context);150 // }151 152 145 }; 153 146 -
trunk/IPs/systemC/Environment/include/Environment_Parameters.h
r81 r88 8 8 #include "../RamLock/include/RamLock_Parameters.h" 9 9 #include "../Sim2OS/include/Sim2OS_Parameters.h" 10 #include "../../processor/Morpheo/Common/include/ToString.h" 10 11 11 12 namespace environment { … … 13 14 class Parameters 14 15 { 15 public : uint32_t nb_iport;16 public : uint32_t nb_dport;17 public : uint32_t nb_entity;18 public : uint32_t * icache_dedicated_nb_port;19 public : uint32_t * dcache_dedicated_nb_port;20 21 public : uint32_t * iaccess_nb_context ;22 public : uint32_t * iaccess_nb_packet ;23 public : uint32_t * iaccess_size_address ;24 public : uint32_t * iaccess_nb_instruction;25 public : uint32_t * iaccess_size_instruction;26 27 public : uint32_t * daccess_nb_context ;28 public : uint32_t * daccess_nb_packet ;29 public : uint32_t * daccess_size_address ;30 public : uint32_t * daccess_size_data ;16 public : uint32_t nb_iport ; 17 public : uint32_t nb_dport ; 18 public : uint32_t nb_entity ; 19 public : uint32_t * icache_dedicated_nb_port; //[nb_entity] 20 public : uint32_t * dcache_dedicated_nb_port; //[nb_entity] 21 22 public : uint32_t * iaccess_nb_context ; //[nb_entity] 23 public : uint32_t * iaccess_nb_packet ; //[nb_entity] 24 public : uint32_t * iaccess_size_address ; //[nb_entity] 25 public : uint32_t * iaccess_nb_instruction ; //[nb_entity] 26 public : uint32_t * iaccess_size_instruction; //[nb_entity] 27 28 public : uint32_t * daccess_nb_context ; //[nb_entity] 29 public : uint32_t * daccess_nb_packet ; //[nb_entity] 30 public : uint32_t * daccess_size_address ; //[nb_entity] 31 public : uint32_t * daccess_size_data ; //[nb_entity] 31 32 32 33 // Parameters cache 33 public : cache::Parameters * param_cache;34 public : cache::Parameters * param_cache ; 34 35 // Parameters tty 35 public : uint32_t nb_component_tty;36 public : uint32_t * tty_address;37 public : tty::Parameters ** param_tty;36 public : uint32_t nb_component_tty ; 37 public : uint32_t * tty_address ; //[nb_component_tty] 38 public : tty::Parameters ** param_tty ; //[nb_component_tty] 38 39 // Parameters ramlock 39 public : uint32_t nb_component_ramlock;40 public : uint32_t * ramlock_address;41 public : ramlock::Parameters ** param_ramlock;40 public : uint32_t nb_component_ramlock ; 41 public : uint32_t * ramlock_address ; //[nb_component_ramlock] 42 public : ramlock::Parameters ** param_ramlock ; //[nb_component_ramlock] 42 43 // Parameters sim2OS 43 public : uint32_t sim2os_address;44 public : uint32_t sim2os_size;45 public : sim2os::Parameters * param_sim2os;44 public : uint32_t sim2os_address ; 45 public : uint32_t sim2os_size ; 46 public : sim2os::Parameters * param_sim2os ; 46 47 // Parameters data 47 public : data::Parameters * param_data;48 public : data::Parameters * param_data ; 48 49 49 50 // Parameters buffer_respons 50 public : queue::Parameters ** param_buffer_irsp;51 public : queue::Parameters ** param_buffer_drsp;51 public : queue::Parameters ** param_buffer_irsp ; //[nb_entity] 52 public : queue::Parameters ** param_buffer_drsp ; //[nb_entity] 52 53 53 54 public : Parameters (// General … … 232 233 delete param_cache; 233 234 } 235 236 public : std::string print (uint32_t depth) 237 { 238 std::string tab = std::string(depth,'\t'); 239 std::string str = ""; 240 241 str+=tab+"nb_entity : "+morpheo::toString(nb_entity)+"\n"; 242 str+=tab+"nb_iport : "+morpheo::toString(nb_iport )+"\n"; 243 str+=tab+"nb_dport : "+morpheo::toString(nb_dport )+"\n"; 244 for (uint32_t i=0; i<nb_entity; ++i) 245 { 246 str+=tab+"ENTITY ["+morpheo::toString(i)+"]\n"; 247 str+=tab+" * icache_dedicated_nb_port : "+morpheo::toString(icache_dedicated_nb_port[i])+"\n"; 248 str+=tab+" * dcache_dedicated_nb_port : "+morpheo::toString(dcache_dedicated_nb_port[i])+"\n"; 249 str+=tab+" * iaccess_nb_context : "+morpheo::toString(iaccess_nb_context [i])+"\n"; 250 str+=tab+" * iaccess_nb_packet : "+morpheo::toString(iaccess_nb_packet [i])+"\n"; 251 str+=tab+" * iaccess_size_address : "+morpheo::toString(iaccess_size_address [i])+"\n"; 252 str+=tab+" * iaccess_nb_instruction : "+morpheo::toString(iaccess_nb_instruction [i])+"\n"; 253 str+=tab+" * iaccess_size_instruction : "+morpheo::toString(iaccess_size_instruction[i])+"\n"; 254 str+=tab+" * daccess_nb_context : "+morpheo::toString(daccess_nb_context [i])+"\n"; 255 str+=tab+" * daccess_nb_packet : "+morpheo::toString(daccess_nb_packet [i])+"\n"; 256 str+=tab+" * daccess_size_address : "+morpheo::toString(daccess_size_address [i])+"\n"; 257 str+=tab+" * daccess_size_data : "+morpheo::toString(daccess_size_data [i])+"\n"; 258 } 259 260 str+=tab+"CACHE\n"; 261 str+=param_cache->print(depth+1); 262 263 // str+=tab+"nb_component_tty : "+morpheo::toString(nb_component_tty )+"\n"; 264 // for (uint32_t i=0; i<nb_component_tty; ++i) 265 // { 266 // str+=tab+"TTY ["+morpheo::toString(i)+"]\n"; 267 // str+=tab+" * tty_address : "+morpheo::toString(tty_address [i])+"\n"; 268 // str+=param_tty->print(depth+1); 269 // } 270 271 // str+=tab+"nb_component_ramlock : "+morpheo::toString(nb_component_ramlock )+"\n"; 272 // for (uint32_t i=0; i<nb_component_ramlock; ++i) 273 // { 274 // str+=tab+"RAMLOCK ["+morpheo::toString(i)+"]\n"; 275 // str+=tab+" * ramlock_address : "+morpheo::toString(ramlock_address [i])+"\n"; 276 // str+=param_ramlock->print(depth+1); 277 // } 278 279 // str+=tab+"SIM2OS\n"; 280 // str+=tab+"sim2os_address : "+morpheo::toString(sim2os_address)+"\n"; 281 // str+=tab+"sim2os_size : "+morpheo::toString(sim2os_size )+"\n"; 282 // str+=param_sim2os->print(depth+1); 283 284 // str+=tab+"DATA\n"; 285 // str+=param_data->print(depth+1); 286 287 // for (uint32_t i=0; i<nb_entity; ++i) 288 // { 289 // str+=tab+"BUFFER_IRSP ["+morpheo::toString(i)+"]\n"; 290 // str+=param_buffer_irsp[i]_data->print(depth+1); 291 // } 292 293 // for (uint32_t i=0; i<nb_entity; ++i) 294 // { 295 // str+=tab+"BUFFER_DRSP ["+morpheo::toString(i)+"]\n"; 296 // str+=param_buffer_drsp[i]_data->print(depth+1); 297 // } 298 299 return str; 300 } 301 302 // public : friend std::ostream& operator<< (std::ostream& output, const Parameters &x) 303 // { 304 // x.print(0); 305 // return output; 306 // } 234 307 }; 235 308 -
trunk/IPs/systemC/Environment/include/Types.h
r81 r88 2 2 #define ENVIRONMENT_TYPES_H 3 3 4 #include "../../processor/Morpheo/ Behavioural/include/Types.h"4 #include "../../processor/Morpheo/TopLevel/include/Types.h" 5 5 #include "../../processor/Morpheo/Behavioural/include/Constants.h" 6 6 #include "../Cache/include/Types.h" … … 9 9 { 10 10 11 typedef morpheo::behavioural::Tcontrol_t Tcontrol_t ;11 // typedef morpheo::behavioural::Tcontrol_t Tcontrol_t ; 12 12 13 typedef morpheo::behavioural::Tcontext_t Ticache_context_t ;14 typedef morpheo::behavioural::Tpacket_t Ticache_packet_t ;15 typedef morpheo::behavioural::Ticache_address_t Ticache_address_t ;16 typedef morpheo::behavioural::Ticache_type_t Ticache_type_t ;17 typedef morpheo::behavioural::Ticache_instruction_t Ticache_instruction_t;18 typedef morpheo::behavioural::Ticache_error_t Ticache_error_t ;13 // typedef morpheo::behavioural::Tcontext_t Ticache_context_t ; 14 // typedef morpheo::behavioural::Tpacket_t Ticache_packet_t ; 15 // typedef morpheo::behavioural::Ticache_address_t Ticache_address_t ; 16 // typedef morpheo::behavioural::Ticache_type_t Ticache_type_t ; 17 // typedef morpheo::behavioural::Ticache_instruction_t Ticache_instruction_t; 18 // typedef morpheo::behavioural::Ticache_error_t Ticache_error_t ; 19 19 20 typedef morpheo::behavioural::Tcontext_t Tdcache_context_t ; 21 typedef morpheo::behavioural::Tpacket_t Tdcache_packet_t ; 22 typedef morpheo::behavioural::Tdcache_address_t Tdcache_address_t ; 23 typedef morpheo::behavioural::Tdcache_type_t Tdcache_type_t ; 24 typedef morpheo::behavioural::Tdcache_data_t Tdcache_data_t ; 25 typedef morpheo::behavioural::Tdcache_error_t Tdcache_error_t ; 20 // typedef morpheo::behavioural::Tcontext_t Tdcache_context_t ; 21 // typedef morpheo::behavioural::Tpacket_t Tdcache_packet_t ; 22 // typedef morpheo::behavioural::Tdcache_address_t Tdcache_address_t ; 23 // typedef morpheo::behavioural::Tdcache_type_t Tdcache_type_t ; 24 // typedef morpheo::behavioural::Tdcache_data_t Tdcache_data_t ; 25 // typedef morpheo::behavioural::Tdcache_error_t Tdcache_error_t ; 26 26 27 }; 27 28 #endif -
trunk/IPs/systemC/Environment/selftest/main.cpp
r81 r88 4 4 using namespace std; 5 5 using namespace environment; 6 using namespace morpheo; 6 7 7 8 #define _TEST_IMEMORY_ true … … 206 207 dcache_miss_penality, 207 208 1 , 208 // 209 // cache_shared_nb_port , 209 210 cache_shared_nb_line , 210 211 cache_shared_size_line , … … 218 219 nb_tty, 219 220 name_tty, 220 false, 221 false, // don't execute xtty 221 222 222 223 nb_component_ramlock, … … 458 459 ICACHE_REQ_VAL [i][j]->write((addr < addr_max) and ((rand()%100)<percent_transaction_icache_req)); 459 460 ICACHE_REQ_CONTEXT_ID [i][j]->write(0); 460 ICACHE_REQ_ADDRESS [i][j]->write(addr );461 ICACHE_REQ_ADDRESS [i][j]->write(addr>>2); 461 462 ICACHE_REQ_PACKET_ID [i][j]->write(addr>>2); 462 463 ICACHE_REQ_TYPE [i][j]->write(ICACHE_TYPE_LOAD); … … 535 536 ICACHE_REQ_VAL [0][0]->write(1); 536 537 ICACHE_REQ_CONTEXT_ID [0][0]->write(0); 537 ICACHE_REQ_ADDRESS [0][0]->write(0xe0000000 );538 ICACHE_REQ_ADDRESS [0][0]->write(0xe0000000>>2); 538 539 ICACHE_REQ_PACKET_ID [0][0]->write(21); 539 540 ICACHE_REQ_TYPE [0][0]->write(ICACHE_TYPE_LOAD); … … 561 562 ICACHE_REQ_VAL [0][0]->write(1); 562 563 ICACHE_REQ_CONTEXT_ID [0][0]->write(0); 563 ICACHE_REQ_ADDRESS [0][0]->write(0xa0000000 );564 ICACHE_REQ_ADDRESS [0][0]->write(0xa0000000>>2); 564 565 ICACHE_REQ_PACKET_ID [0][0]->write(21); 565 566 ICACHE_REQ_TYPE [0][0]->write(ICACHE_TYPE_LOAD); -
trunk/IPs/systemC/Environment/src/Environment.cpp
r81 r88 1 1 #include "../include/Environment.h" 2 3 using namespace morpheo; 2 4 3 5 namespace environment { … … 60 62 61 63 62 63 64 64 for (uint32_t i=0; i<param->nb_entity; i++) 65 65 { … … 79 79 read_dram[0] = new char [max_data_size/8]; 80 80 write_dram = new char [max_data_size/8]; 81 context_stop = new bool [param->nb_entity]; 82 for (uint32_t i=0; i<param->nb_entity; ++i) 83 context_stop [i] = false; 84 nb_context_stop = 0; 81 85 82 86 // Port -
trunk/IPs/systemC/Environment/src/Environment_genMoore.cpp
r81 r88 1 1 #include "../include/Environment.h" 2 3 using namespace morpheo; 2 4 3 5 namespace environment { -
trunk/IPs/systemC/Environment/src/Environment_transition.cpp
r81 r88 1 1 #include "../include/Environment.h" 2 3 using namespace morpheo; 2 4 3 5 namespace environment { … … 43 45 Ticache_context_t context = ICACHE_REQ_CONTEXT_ID [i][j]->read();// TODO : test presence 44 46 Ticache_packet_t packet = ICACHE_REQ_PACKET_ID [i][j]->read();// TODO : test presence 45 Ticache_address_t address = ICACHE_REQ_ADDRESS [i][j]->read() ;47 Ticache_address_t address = ICACHE_REQ_ADDRESS [i][j]->read()<<2; 46 48 Ticache_type_t type = ICACHE_REQ_TYPE [i][j]->read(); 47 uint32_t size = param->iaccess_size_address [i]/8;49 uint32_t size = (param->iaccess_size_address [i]+2)/8; 48 50 49 51 _cout(ENVIRONMENT," * information\n"); … … 67 69 (entity.segment->getType() == data::TYPE_TARGET_MEMORY)) 68 70 { 69 _cout(ENVIRONMENT, 71 _cout(ENVIRONMENT," * OK !\n"); 70 72 bus_error = false; 71 73 uncached = entity.segment->getUncached(); … … 73 75 if (must_read == true) // Test if must read the ram 74 76 { 75 _cout(ENVIRONMENT, 77 _cout(ENVIRONMENT," * must read\n"); 76 78 // Read all instruction 77 79 for (unsigned int k=0; k<param->iaccess_nb_instruction[i]; k++) 78 80 { 79 81 uint32_t addr = address+k*(size); 80 _cout(ENVIRONMENT, " * addr: %.8x\n",addr);82 _cout(ENVIRONMENT," * addr : %.8x\n",addr); 81 83 82 84 bus_error |= !component_data->read(addr,size,read_iram[k]); … … 84 86 // Swap if endienness is different 85 87 if (endianness::isSameEndianness(context) == false) 86 read_iram[k] = endianness::swapBytes(read_iram[k],size,size); 88 { 89 read_iram[k] = endianness::swapBytes(read_iram[k],size,size); 90 } 91 92 _cout(ENVIRONMENT," * inst :"); 93 for (int32_t cpt=(param->iaccess_size_instruction[context]/8)-1; cpt>=0; --cpt) 94 _cout(ENVIRONMENT, "%.2x",0xff&static_cast<uint32_t>(read_iram[k][cpt])); 95 _cout(ENVIRONMENT, "\n"); 87 96 } 88 97 } … … 241 250 ,static_cast<uint32_t>((wdata>> 0)&0xff) 242 251 ); 252 253 stop (context); 243 254 244 // if (context_stop [context] == false)245 // {246 // context_stop [context] = true;247 // nb_context_stop ++;248 249 // if (nb_context_stop >= nb_context)250 // sc_stop();251 // }252 253 255 break; 254 256 } … … 387 389 { 388 390 // Decomposition en groupe octect 389 Tdcache_data_t result = (Tdcache_data_t)(component_sim2os->result);391 Tdcache_data_t result = static_cast<Tdcache_data_t>(reinterpret_cast<uint64_t>(component_sim2os->result)); 390 392 _cout(ENVIRONMENT,"<sim2os> result : %x\n",result); 391 393 … … 494 496 component_buffer_drsp [i]->push(latence,rsp); 495 497 } 496 497 498 } 498 499 //=============================================================================
Note: See TracChangeset
for help on using the changeset viewer.