OpenCores
URL https://opencores.org/ocsvn/async_sdm_noc/async_sdm_noc/trunk

Subversion Repositories async_sdm_noc

[/] [async_sdm_noc/] [trunk/] [sdm/] [tb/] [ni.h] - Blame information for rev 47

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 31 wsong0210
/*
2
 Asynchronous SDM NoC
3
 (C)2011 Wei Song
4
 Advanced Processor Technologies Group
5
 Computer Science, the Univ. of Manchester, UK
6
 
7
 Authors:
8
 Wei Song     wsong83@gmail.com
9
 
10
 License: LGPL 3.0 or later
11
 
12
 A SystemC network adapter/interface for NoC simulation.
13
 
14
 History:
15
 20/08/2008  Initial version. <wsong83@gmail.com>
16
 30/09/2010  Use template style packet definition. <wsong83@gmail.com>
17
 16/10/2010  Support SDM. <wsong83@gmail.com>
18 47 wsong0210
 30/05/2011  Clean up for opensource. <wsong83@gmail.com>
19 31 wsong0210
 
20
*/
21
 
22
#ifndef NETWORK_ADAPTER_H_
23
#define NETWORK_ADAPTER_H_
24
 
25 32 wsong0210
#include "define.h"
26 31 wsong0210
#include <systemc.h>
27
 
28
SC_MODULE(Network_Adapter)
29
{
30
 
31
public:
32
    SC_HAS_PROCESS(Network_Adapter);
33
    Network_Adapter(
34
             sc_module_name     name // module name
35
            ,unsigned int       x    // location x
36
            ,unsigned int       y    // location y
37
        );
38
    ~Network_Adapter();
39
 
40
    // interface with processor
41
    sc_port<sc_fifo_in_if<FRAME> >      frame_in; // frame for transmission
42
    sc_port<sc_fifo_out_if<FRAME> >     frame_out; // frame for receiving
43
 
44
    // interface with router
45
    sc_port<sc_fifo_in_if<FLIT> > IP [SubChN]; // input port from IO driver
46
    sc_port<sc_fifo_out_if<FLIT> > OP [SubChN]; // output port to IO driver
47
 
48
private:
49
    unsigned int loc_x,loc_y; // location information
50
 
51
    // functional thread
52
    void ibuffer_thread(unsigned int); // input buffer respond thread
53
    void obuffer_thread(unsigned int); // output buffer respond thread
54
 
55
    // other functions
56
    bool check_frame(const FRAME& frame); // check the correctness of frame received
57
};
58
 
59
#endif /*NETWORK_ADAPTER_H_*/

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.