Changeset 134 for trunk/IPs/systemC/Environment/Data
- Timestamp:
- Jul 15, 2009, 10:41:01 AM (15 years ago)
- Location:
- trunk/IPs/systemC/Environment/Data
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/Environment/Data/include/Segment.h
r88 r134 23 23 protected : type_target_t type; 24 24 25 25 //public : Segment (void); 26 26 public : Segment (SEGMENT_TABLE_ENTRY * segment); 27 27 public : ~Segment (void); -
trunk/IPs/systemC/Environment/Data/selftest/main.cpp
r81 r134 31 31 32 32 { 33 Segment * seg1 = new Segment ();33 // Segment * seg1 = new Segment (); 34 34 35 TEST(seg1->getType (), TYPE_TARGET_MEMORY);36 TEST(seg1->getIndex (), 0);37 TEST(seg1->getBase (), 0);38 TEST(seg1->getSize (), 0);39 TEST(seg1->getUncached (), false);35 // TEST(seg1->getType (), TYPE_TARGET_MEMORY); 36 // TEST(seg1->getIndex (), 0); 37 // TEST(seg1->getBase (), 0); 38 // TEST(seg1->getSize (), 0); 39 // TEST(seg1->getUncached (), false); 40 40 41 seg1->define_target(TYPE_TARGET_SIM2OS,4);42 TEST(seg1->getType (), TYPE_TARGET_SIM2OS);43 TEST(seg1->getIndex (), 4);41 // seg1->define_target(TYPE_TARGET_SIM2OS,4); 42 // TEST(seg1->getType (), TYPE_TARGET_SIM2OS); 43 // TEST(seg1->getIndex (), 4); 44 44 45 cout << *seg1 << endl;45 // cout << *seg1 << endl; 46 46 47 47 SEGMENT_TABLE_ENTRY * entry = new SEGMENT_TABLE_ENTRY("entry", 0x100, 0x1024, 21, 7, true); … … 104 104 delete seg2; 105 105 delete entry; 106 delete seg1;106 // delete seg1; 107 107 } 108 108 -
trunk/IPs/systemC/Environment/Data/src/Data_read.cpp
r81 r134 6 6 bool Data::read (uint32_t address, uint32_t size, char * & data_dest) 7 7 { 8 // for (uint32_t i=0; i<size; ++i) 9 // data_dest[i] = '\0'; 10 8 11 uint32_t num_seg = 0; 9 bool res = false; 10 12 11 13 // Scan all segment 12 for ( num_seg = 0; num_seg < nb_seg; num_seg ++)14 for (; num_seg < nb_seg; num_seg ++) 13 15 if (segment[num_seg]->test (address,size) == true) 14 16 { 15 17 segment[num_seg]->read (address,size,data_dest); 16 res = true;17 18 break; 18 19 } 19 20 20 return res;21 return (num_seg < nb_seg); 21 22 } 22 23 -
trunk/IPs/systemC/Environment/Data/src/Segment.cpp
r81 r134 4 4 namespace data { 5 5 6 Segment::Segment (void)7 {8 name = "";9 base = 0;10 size = 0;11 uncached = false;12 data = NULL;13 type = TYPE_TARGET_MEMORY;14 index = 0;15 }6 // Segment::Segment (void) 7 // { 8 // name = ""; 9 // base = 0; 10 // size = 0; 11 // uncached = false; 12 // data = NULL; 13 // type = TYPE_TARGET_MEMORY; 14 // index = 0; 15 // } 16 16 17 17 Segment::Segment (SEGMENT_TABLE_ENTRY * segment) … … 25 25 type = TYPE_TARGET_MEMORY; 26 26 index = 0; 27 memset((void*)data,0,size * sizeof(char)); 27 28 } 28 29 -
trunk/IPs/systemC/Environment/Data/src/Segment_read.cpp
r81 r134 1 1 #include "../include/Segment.h" 2 #include "../../Common/include/Debug.h" 2 3 3 4 namespace environment { … … 6 7 void Segment::read (uint32_t address, uint32_t size, char * & data_dest) 7 8 { 9 // _cout(true," * kane\n"); 10 // _cout(true," * address : %.8x\n",address); 8 11 for (uint32_t it = 0; it < size ; it ++) 9 data_dest [it] = data[address-base+it]; 12 { 13 data_dest [it] = data[address-base+it]; 14 // _cout(true," * [%d] : %.8x\n",address-base+it,static_cast<uint32_t>(data_dest [it])); 15 } 10 16 } 11 17 -
trunk/IPs/systemC/Environment/Data/src/loadexec.c
r122 r134 142 142 *eoffset = ringo.ladr; 143 143 ringo.mem = malloc(*esize * sizeof(char)); 144 145 memset((void *)ringo.mem,0,*esize * sizeof(char)); 146 144 147 /* Start over again from the start of the memory */ 145 148 bfd_map_over_sections(exec, bindsection, &ringo);
Note: See TracChangeset
for help on using the changeset viewer.