Jump to content

need help :( : Error: (E109) complete binding failed: 4 binds exceeds maximum of 1 allowed: port 'adc_sub_1.sca_tdf_in_0' (sca_tdf::sca_in) In file: ../../../../source/src/sysc/communication/sc_port.cpp:231


Recommended Posts

hello;

i need your help

thank you;

Error: (E109) complete binding failed: 4 binds exceeds maximum of 1 allowed: port 'adc_sub_1.sca_tdf_in_0' (sca_tdf::sca_in)
In file: ../../../../source/src/sysc/communication/sc_port.cpp:231
 

 

my code is here :

this is the first bloc :

image.h

#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <stdio.h>

#include "systemc-ams.h"
#include "systemc.h"

template< int n , int m >
 
SCA_TDF_MODULE( image) {

sca_tdf::sca_out<double> out[n][m] ;

double data[n][m];

double fsimu;
void initialize(double _fsimu){
fsimu=_fsimu;}

void set_attributes(){
out.set_timestep(1/fsimu,SC_SEC);
}

void processing(){


std::ifstream fichier("MatrixFile/log0.txt" , "r");
if (fichier != NULL){
for ( int i=0; i<n; i++){
for ( int j=0; j<m; j++){
fichier >> data[i][j];

out.write(data[i][j]);}}}
}

SCA_CTOR(image){}
};

 

the  second bloc (it's a ADC to digitize the image) , each line from the image will processed by one ADC . 

 

 main.cpp

 

#include <iostream>
#include <fstream>
#include <stdlib.h>
#include "systemc-ams.h"
#include "systemc.h"
#include "image.h"
#include "sigmadelta.h"

 
//#include "transducteur.h" 

 int sc_main(int argc, char *argv[])
 {

 sc_set_time_resolution(1, SC_FS); 
  
  const int OSR = 32;
  double BW = 50e3;
  double fs = 2.0 * BW*OSR ;  
  const int sim_rate=10;
 int N_line = 4;
int NB_elements_trans = 3; 


  
  
sca_tdf::sca_signal<double>sig_data[NB_elements_trans][N_LINE];         

 sca_tdf::sca_signal<double>sig_adc[NB_elements_trans];
 sc_clock my_clk ("my_clk", 0.0020, SC_MS, 0.5, 0.0010, SC_MS, true);
  
adc* adc_sub[NB_elements_trans]; 

donnee <3,4> *i_donnee = new donnee <3,4>( "i_donnee" );
         for ( int i=0; i<NB_elements_trans ; i++){
              for ( int j=0; j<N_LINE ; j++){
    
                  i_donnee-> out[i][j] (sig_data[i][j]); }
                  i_donnee -> initialize(sim_rate*fs) ;}


for ( int i=0; i<NB_elements_trans ; i++){ 
for ( int j=0; j<N_LINE ; j++){

adc_sub[i] = new adc("adc_sub");

   adc_sub[i]->in(sig_data[i][j]);  }

 adc_sub[i]->out(sig_adc[i]);
  adc_sub[i]->clock(my_clk);
 adc_sub[i]->initialize(fs,sim_rate);}
  fs= 2*fs ;
  
  

// TRACE  
 
  sca_util::sca_trace_file *tf1 = sca_util::sca_create_tabular_trace_file( "wave.dat" );
 for ( int i=0; i<NB_elements_trans; i++){
for ( int j=0; j<N_LINE; j++){
 
  sca_util::sca_trace(tf1,sig_data[i][j],"sig_data"); } }
  
 
    
    
     for ( int i=0; i<NB_elements_trans ; i++){

        sca_util::sca_trace(tf1,sig_adc[i],"sig_adc"); }

  

  sc_start( N/fs , SC_SEC);
  sca_util::sca_close_tabular_trace_file(tf1); 
  //sca_util::sca_close_tabular_trace_file(tf2); 
  cout<< endl<< sc_time_stamp() << " sc_main finished" << endl;
  
  
  
   return 0;
  
  
  

Link to comment
Share on other sites

  • anna changed the title to need help :( : Error: (E109) complete binding failed: 4 binds exceeds maximum of 1 allowed: port 'adc_sub_1.sca_tdf_in_0' (sca_tdf::sca_in) In file: ../../../../source/src/sysc/communication/sc_port.cpp:231
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...