Jump to content

cannot understand error


Uzmeed

Recommended Posts

hi 

 

I have written the following code for register transfer logic

#include "systemc.h"
#include "UART_tx.h"

void UART_tx :: Register_Transfer()
{
    bool reset;
    int XMT_shft;
    int bit_count;

    //int word_size=8;
    bool load_XMT_shftreg;
    int clear;
    int shift;
    int start;
    sc_int<9> XMT_shftreg;

    if(reset==false){
        XMT_shft=all_ones;
        bit_count=0;
    }

    else
    if(load_XMT_datareg==1)
        XMT_datareg=data_bus;
    if(load_XMT_shftreg==1)
        XMT_shftreg=(XMT_datareg,1);
    if(start==1)
        XMT_shftreg[0]=0;
    if(clear==1)
        bit_count=0;
    else if (shift==1){
        bit_count=bit_count+1;
        XMT_shftreg=(1,XMT_shftreg.range(8,1));
    }

}
 

 

and getting the following error while synthesis

 

@E [HLS-70] In file included from C:/Users/Home/UART_proj/UART_proj/solution1/.autopilot/db/Register_Transfer.pragma.1.cpp:1:
In file included from UART_proj/Register_Transfer.cpp:1:
In file included from UART_proj/Register_Transfer.cpp:1:
In file included from C:/Xilinx/Vivado_HLS/2015.4/common/technology/autopilot/ap_sysc\systemc.h:1:
In file included from C:/Xilinx/Vivado_HLS/2015.4/common/technology/autopilot/ap_sysc/ap_systemc.h:51:
C:/Xilinx/Vivado_HLS/2015.4/common/technology/autopilot/ap_sysc/ap_sc_core.h:356:20: error: const_cast to '_ap_sc_::sc_core::sc_in<_ap_sc_::sc_dt::sc_int<8> >', which is not a reference, pointer-to-object, or pointer-to-data-member
            return const_cast<sc_in>(this)->read();
                   ^~~~~~~~~~~~~~~~~~~~~~~
UART_proj/Register_Transfer.cpp:24:15: note: in instantiation of member function '_ap_sc_::sc_core::sc_in<_ap_sc_::sc_dt::sc_int<8> >::operator const struct _ap_sc_::sc_dt::sc_int<8> &' requested here
  XMT_datareg=data_bus;
              ^
1 error generated.
Compilation of the preprocessed source 'Register_Transfer.g' failed
    while executing
"source C:/Users/Home/UART_proj/UART_proj/solution1/csynth.tcl"
    invoked from within
"hls::main C:/Users/Home/UART_proj/UART_proj/solution1/csynth.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel 1 hls::main {*}$args"
    (procedure "hls_proc" line 5)
    invoked from within
"hls_proc $argv"
 

 

Link to comment
Share on other sites

After making some changes now i am getting the following error

the project is attached 

your immediate response id highly regarded

 

@E [HLS-70] In file included from C:/Users/Home/UART_rx/UART_rx/solution1/.autopilot/db/Output_n_nextstate.pragma.1.cpp:1:
In file included from UART_rx/Output_n_nextstate.cpp:1:
In file included from UART_rx/Output_n_nextstate.cpp:1:
In file included from C:/Xilinx/Vivado_HLS/2015.4/common/technology/autopilot/ap_sysc\systemc.h:1:
In file included from C:/Xilinx/Vivado_HLS/2015.4/common/technology/autopilot/ap_sysc/ap_systemc.h:51:
C:/Xilinx/Vivado_HLS/2015.4/common/technology/autopilot/ap_sysc/ap_sc_core.h:206:15: error: no viable conversion from 'const _ap_sc_::sc_core::sc_signal_inout_if<int>' to 'int'
            T v = v2;
              ^   ~~
C:/Xilinx/Vivado_HLS/2015.4/common/technology/autopilot/ap_sysc/ap_sc_core.h:200:13: note: in instantiation of function template specialization '_ap_sc_::sc_core::sc_signal_inout_if<int>::write<_ap_sc_::sc_core::sc_signal_inout_if<int> >' requested here
            write(v);
            ^
C:/Xilinx/Vivado_HLS/2015.4/common/technology/autopilot/ap_sysc/ap_sc_core.h:322:11: note: in instantiation of member function '_ap_sc_::sc_core::sc_signal_inout_if<int>::operator=' requested here
    class sc_signal : public sc_signal_inout_if<T> {
          ^
C:/Xilinx/Vivado_HLS/2015.4/common/technology/autopilot/ap_sysc/ap_sc_core.h:187:9: note: candidate function not viable: 'this' argument has type 'const _ap_sc_::sc_core::sc_signal_inout_if<int>', but method is not marked const
        operator const T () { return this->read(); }
        ^
1 error generated.
Compilation of the preprocessed source 'Output_n_nextstate.g' failed
    while executing
"source C:/Users/Home/UART_rx/UART_rx/solution1/csynth.tcl"
    invoked from within
"hls::main C:/Users/Home/UART_rx/UART_rx/solution1/csynth.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel 1 hls::main {*}$args"
    (procedure "hls_proc" line 5)
    invoked from within
"hls_proc $argv"
 

UART_tx.h

State_Transition.cpp

Register_Transfer.cpp

Output_n_nextstate.cpp

main.cpp

Link to comment
Share on other sites

  • 2 weeks 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...