KMLM List
View email archives for the history of this mailing list.
|
|
|
|
systemc-forum - SystemC Design Issue
|
Message Thread:
Previous |
Next
|
- To: <systemc-forum@xxxxxxxxxxxxxxxxx>
- From: vince vince <vincekoskesh@xxxxxxxxxxx>
- Date: Tue, 15 Dec 2009 02:09:01 -0500
- Send Email to systemc-forum@lists.systemc.org:
- Send new message
- Reply to this message
|
Hi all,
I have a systemC design issue. I am trying to dynamically create an array of
sc_fifo (same as sc_fwft_fifo in my code) and dynamically assign them to the
appropriate ports. However, I get:
g++ -I. -I/home/vinnyp/systemc-2.2.0/include -I./common_constants
-I./cache_protocol -I./cache_protocol/state -I./cache_protocol/protocol
-I./cache_share_protocol -I./cache -I./memory_controller_arbiter
-I./memory_controller -I./network_logic -I./app_engine -I./msg/app_cache_msg
-I./msg/cache_cache_msg -I./msg/cache_mem_msg -I./msg/cache_data_table_msg
-I./msg/cache_data_protocol_msg -I./msg/cache_table_protocol_msg -I./fwft_fifo
-I./error -L. -L/home/vinnyp/systemc-2.2.0/lib-linux -o run sim/sc_main.cpp
-lsystemc -lm
In file included from sim/sc_main.cpp:2:
./cache/cache.cpp: In constructor ‘cache::cache(sc_core::sc_module_name,
unsigned int, unsigned int)’:
./cache/cache.cpp:75: error: no match for call to
‘(sc_core::sc_fwft_fifo<cache_cache_msg>) (const char*, int)’
./cache/cache.cpp:76: error: no match for call to
‘(sc_core::sc_fwft_fifo<cache_cache_msg>) (const char*, int)’
/home/vinnyp/systemc-2.2.0/include/sysc/communication/sc_fifo_ports.h:172:
error: ‘sc_core::sc_fifo_in<T>& sc_core::sc_fifo_in<T>::operator=(const
sc_core::sc_fifo_in<T>&) [with T = app_cache_msg]’ is private
./cache/cache.cpp:79: error: within this context
/home/vinnyp/systemc-2.2.0/include/sysc/communication/sc_fifo_ports.h:285:
error: ‘sc_core::sc_fifo_out<T>& sc_core::sc_fifo_out<T>::operator=(const
sc_core::sc_fifo_out<T>&) [with T = app_cache_msg]’ is private
./cache/cache.cpp:80: error: within this context
./cache/cache.cpp:84: error: no match for call to
‘(sc_core::sc_fwft_fifo_in<cache_cache_msg>)
(sc_core::sc_fwft_fifo<cache_cache_msg>*&)’
/home/vinnyp/systemc-2.2.0/include/sysc/communication/sc_port.h:310: note:
candidates are: void sc_core::sc_port_b<IF>::operator()(IF&) [with IF =
sc_core::sc_fwft_fifo_in_if<cache_cache_msg>]
/home/vinnyp/systemc-2.2.0/include/sysc/communication/sc_port.h:319: note:
void sc_core::sc_port_b<IF>::operator()(sc_core::sc_port_b<IF>&)
[with IF = sc_core::sc_fwft_fifo_in_if<cache_cache_msg>]
./cache/cache.cpp:85: error: no match for call to
‘(sc_core::sc_fwft_fifo_out<cache_cache_msg>)
(sc_core::sc_fwft_fifo<cache_cache_msg>*&)’
/home/vinnyp/systemc-2.2.0/include/sysc/communication/sc_port.h:310: note:
candidates are: void sc_core::sc_port_b<IF>::operator()(IF&) [with IF =
sc_core::sc_fwft_fifo_out_if<cache_cache_msg>]
/home/vinnyp/systemc-2.2.0/include/sysc/communication/sc_port.h:319: note:
void sc_core::sc_port_b<IF>::operator()(sc_core::sc_port_b<IF>&)
[with IF = sc_core::sc_fwft_fifo_out_if<cache_cache_msg>]
make: *** [sys] Error 1
With this code:
#include <vector>
#include <values.h>
#include "common_constants.h"
#include "cache_constants.h"
#include "app_cache_msg.h"
#include "cache_cache_msg.h"
#include "cache_mem_msg.h"
#include "cache_protocol_list.h"
#include "common_cache_attribute.h"
#include "cache_data.h"
#include "cache_table.h"
#include "cache_netif.h"
#include "fwft_fifo.h"
#include "systemc.h"
using namespace std;
using protocol::cache_protocol;
/***********************************************
Cache Module
***********************************************/
class cache: public sc_module {
public:
/***********************************************
INPUT/OUTPUT PORTS
***********************************************/
sc_in<bool> clock;
sc_in<bool> reset;
sc_fifo_in<app_cache_msg> data_in_ports_from_app;
sc_fifo_out<app_cache_msg> data_out_ports_to_app;
sc_fifo_in<cache_mem_msg> data_in_ports_from_mem;
sc_fifo_out<cache_mem_msg> data_out_ports_to_mem;
sc_fwft_fifo_in<cache_cache_msg>
data_in_ports_from_network[C_NUM_NODE_PORTS];
sc_fwft_fifo_out<cache_cache_msg>
data_out_ports_to_network[C_NUM_NODE_PORTS];
/***********************************************
Typedef Variables
***********************************************/
/***********************************************
Module Attributes
***********************************************/
common_cache_attribute my_common_cache_attribute;
protocol::cache_protocol my_cache_protocol;
cache_data my_cache_data;
cache_table my_cache_table;
cache_netif my_cache_netif;
sc_fwft_fifo<cache_table_protocol_msg> protocol_2_table_fifo;
sc_fwft_fifo<cache_table_protocol_msg> table_2_protocol_fifo;
sc_fwft_fifo<cache_cache_msg> *network_2_table_fifo;
sc_fwft_fifo<cache_cache_msg> *table_2_network_fifo;
/***********************************************
Local Variables
***********************************************/
/***********************************************
Helper Function
***********************************************/
void update_my_cache_ID(){
my_common_cache_attribute.my_cache_ID =
(my_common_cache_attribute.my_cache_ID + 1) % C_NUM_NODE_NETWORK;
}
/***********************************************
Constructor for Cache module
***********************************************/
cache(sc_module_name name, unsigned int my_cache_ID, unsigned int size =
C_NUM_CACHE_ENTRY):
sc_module(name),
my_cache_table("my_cache_table", &my_common_cache_attribute),
my_cache_data("my_cache_data", &my_common_cache_attribute),
my_cache_protocol("my_cache_protocol", &my_common_cache_attribute),
my_cache_netif("my_cache_netif"),
protocol_2_table_fifo("protocol_2_table_fifo",1),
table_2_protocol_fifo("table_2_protocol_fifo",1)
{
network_2_table_fifo = new
sc_fwft_fifo<cache_cache_msg>[C_NUM_NODE_PORTS];
table_2_network_fifo = new
sc_fwft_fifo<cache_cache_msg>[C_NUM_NODE_PORTS];
for (unsigned int i = 0; i < C_NUM_NODE_PORTS; i++){
network_2_table_fifo[i]("network_2_table_fifo" + i,1);
table_2_network_fifo[i]("table_2_network_fifo" + i,1);
}
my_common_cache_attribute.my_cache_ID = my_cache_ID;
my_cache_table.data_in_ports_from_app = data_in_ports_from_app;
my_cache_table.data_out_ports_to_app = data_out_ports_to_app;
my_cache_table.data_in_ports_from_protocol(protocol_2_table_fifo);
my_cache_table.data_out_ports_to_protocol(table_2_protocol_fifo);
for (unsigned int i = 0; i < C_NUM_NODE_PORTS; i++){
my_cache_table.data_in_ports_from_network[i](network_2_table_fifo);
my_cache_table.data_out_ports_to_network[i](table_2_network_fifo);
}
}
inline friend void sc_trace(sc_trace_file *tf, const cache & v, const
std::string & NAME ) {
sc_trace(tf,v.my_common_cache_attribute, NAME +
".my_common_cache_attribute");
// sc_trace(tf,v.my_cache_data, NAME + ".my_cache_data");
}
};
any hints or trick? :-)
Thank you,
Vince
_________________________________________________________________
Windows Live: Keep your friends up to date with what you do online.
http://go.microsoft.com/?linkid=9691815
|
|