Uzmeed Posted December 13, 2017 Report Posted December 13, 2017 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" Quote
David Black Posted December 13, 2017 Report Posted December 13, 2017 Pretty much impossible to know exactly what the problem is without the rest of the context. How and were are XMT_datareg and databus defined? Quote
Roman Popov Posted December 13, 2017 Report Posted December 13, 2017 Looks like the error is inside Xilinx libraries internals. I suggest you should ask on Xilinx forums. Quote
Uzmeed Posted December 14, 2017 Author Report Posted December 14, 2017 Hi David All my code is attached main.cpp Output_n_nextstate.cpp Register_Transfer.cpp State_Transition.cpp UART_tx.h Quote
ralph.goergen Posted December 14, 2017 Report Posted December 14, 2017 Hi. Seems as if the compiler is confused by too many implicit casts. Could you try explicit read: XMT_datareg=data_bus.read(); Should save one implicit conversion and might help. Actual root cause could be in the _ap_sc stuff (synthesizer internals?). Greetings Ralph Quote
Uzmeed Posted December 14, 2017 Author Report Posted December 14, 2017 Thanks Ralph It worked Best Regards Uzmeed Quote
Uzmeed Posted December 21, 2017 Author Report Posted December 21, 2017 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 Quote
ralph.goergen Posted January 3, 2018 Report Posted January 3, 2018 Hi. I guess it is the same as before. The implicit conversion from a signal to the type of the inner value is not supported correctly by the HLS library you are using. The following should help again: T v = v2.read(); Greetings Rlaph Quote
Uzmeed Posted January 3, 2018 Author Report Posted January 3, 2018 Thanks Ralph Can you please guide me that how can I convert the sc_fifo signal to simple bus( i know that is not the topic) Quote
Recommended Posts
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.