Last change
on this file since 19 was
18,
checked in by guillaumeb, 15 years ago
|
changement des inclusions de slides
changement des regles pour ctags
|
File size:
1.8 KB
|
Rev | Line | |
---|
[2] | 1 | #include <systemc.h> |
---|
| 2 | #include "util.h" |
---|
| 3 | #include "queue.h" |
---|
| 4 | #include "processing_queue.h" |
---|
| 5 | #include "address.h" |
---|
| 6 | #include "raw_address.h" |
---|
| 7 | #include "cache_store.h" |
---|
| 8 | |
---|
| 9 | using namespace std; |
---|
| 10 | |
---|
| 11 | SC_MODULE(L1Cache) |
---|
| 12 | { |
---|
| 13 | sc_in_clk clock; |
---|
| 14 | |
---|
| 15 | // signal request from processor |
---|
| 16 | sc_in <RawAddress> in_data; |
---|
| 17 | sc_in <bool>in_activate; |
---|
| 18 | |
---|
| 19 | // signal answers to processor |
---|
| 20 | sc_out<RawAddress> out_data; |
---|
| 21 | sc_out<bool> out_activate; |
---|
| 22 | |
---|
| 23 | // XXX temporary signal for out information (for monitoring) |
---|
| 24 | sc_out<bool> miss_info; |
---|
| 25 | sc_out<bool> hit_info; |
---|
| 26 | // Queue de sortie : pour limiter le nombre de requetes simultannées |
---|
| 27 | Queue<Address> *output_queue; |
---|
| 28 | |
---|
| 29 | // CacheStore : contient les lignes actuellement stockées dans le cache |
---|
| 30 | CacheStore *cstore; |
---|
| 31 | |
---|
| 32 | // Processing queue : timeout interne pour l'envoi de données |
---|
| 33 | // qui sont chargées dans ce cache |
---|
| 34 | ProcessingQueue *processing_queue; |
---|
| 35 | |
---|
| 36 | // Latence : delai nécessaire pour temporiser les données chargées dans ce |
---|
| 37 | // cache |
---|
| 38 | unsigned int latency; |
---|
| 39 | |
---|
| 40 | |
---|
| 41 | // methods for handling memory requests (systemc) |
---|
| 42 | void read(); |
---|
| 43 | void write(); |
---|
| 44 | |
---|
| 45 | |
---|
| 46 | |
---|
| 47 | L1Cache(sc_module_name name, int cache_size, int line_width, t_assoc associativity, unsigned int latency) : sc_module(name) |
---|
| 48 | { |
---|
| 49 | this->cstore = new CacheStore(cache_size, line_width, associativity); |
---|
| 50 | this->latency = latency; |
---|
| 51 | |
---|
| 52 | // this->input_queue = new Queue(10); |
---|
| 53 | this->processing_queue = new ProcessingQueue(10); |
---|
| 54 | |
---|
| 55 | SC_METHOD(read); |
---|
| 56 | dont_initialize(); |
---|
| 57 | sensitive << clock.neg(); |
---|
| 58 | |
---|
| 59 | SC_METHOD(write); |
---|
| 60 | dont_initialize(); |
---|
| 61 | sensitive << clock.neg(); |
---|
| 62 | }; |
---|
| 63 | |
---|
| 64 | SC_HAS_PROCESS(L1Cache); |
---|
| 65 | |
---|
| 66 | ~L1Cache() |
---|
| 67 | { |
---|
| 68 | //delete input_queue; |
---|
| 69 | delete processing_queue; |
---|
| 70 | delete cstore; |
---|
| 71 | } |
---|
| 72 | }; |
---|
Note: See
TracBrowser
for help on using the repository browser.