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

Subversion Repositories async_sdm_noc

[/] [async_sdm_noc/] [branches/] [init/] [vc/] [tb/] [rtdriver.h] - Blame information for rev 66

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 43 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
 The port driver between NI and router.
13
 
14
 History:
15
 27/04/2010  Initial version. <wsong83@gmail.com>
16
 03/06/2011  Remove the sc_unit datatype to support data width larger than 64. <wsong83@gmail.com>
17
 
18
*/
19
 
20
#ifndef RT_DRIVER_H_
21
#define RT_DRIVER_H_
22
 
23
#include "define.h"
24
#include <systemc.h>
25
#include "pdu_def.h"
26
 
27
SC_MODULE(RTDriver) {
28
 
29
 public:
30
  // port with network interface
31
  sc_port<sc_fifo_in_if<FLIT> > NI2P;
32
  sc_port<sc_fifo_out_if<FLIT> > P2NI;
33
  sc_out<bool> CP [SubChN];
34
  sc_in<bool > CPa [SubChN];
35
 
36
  // signals from interface to router
37
  sc_out<sc_lv<ChBW*4> > rtid [4];
38
  sc_out<sc_lv<3> > rtift;
39
  sc_out<sc_lv<SubChN> > rtivc;
40
  sc_in<sc_logic> rtia;
41
  sc_in<sc_lv<SubChN> > rtic;
42
  sc_out<sc_lv<SubChN> > rtica;
43
 
44
  sc_in<sc_lv<ChBW*4> > rtod [4];
45
  sc_in<sc_lv<3> > rtoft;
46
  sc_in<sc_lv<SubChN> > rtovc;
47
  sc_out<sc_logic> rtoa;
48
  sc_out<sc_lv<SubChN> > rtoc;
49
  sc_in<sc_lv<SubChN> > rtoca;
50
 
51
  // local variable
52 45 wsong0210
  sc_signal<bool> out_cred[SubChN];     /* the input credit */
53
  sc_signal<bool> out_cred_ack[SubChN]; /* the input credit ack */
54 43 wsong0210
 
55
 
56
  SC_HAS_PROCESS(RTDriver);
57
  RTDriver(sc_module_name name);
58
 
59
  void IPdetect();              // Method to detect the router input port
60
  void OPdetect();              // Method to detect the router output port
61
  void Creditdetect();          // Method to detect the credit ports
62
  void send();                  // thread of sending a flit
63
  void recv();                  // thread to recveive a flit
64
 
65
  sc_signal<bool> rtinp_sig; // fire when the router input port is ready for a new flit
66
  sc_signal<bool> rtoutp_sig; // fire when the router output port has a new flit
67
 
68
  unsigned int c1o42b(unsigned int); // convert 1-of-4 to binary
69
};
70
 
71
 
72
#endif

powered by: WebSVN 2.1.0

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