Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Help with VHDL code for SPI interface on Xilinx Spartan 3A

Status
Not open for further replies.

ptjw

Junior Member level 3
Joined
Apr 29, 2011
Messages
29
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,597
hello all, i have with me a spartan 3 starter board that has 4 LEDs and 4 capacitive touch pads that can be interfaced with. i have an upcoming project that would use the spartan 3A FPGA and i figured this starter board would be a good place for me to start as i have no experience with FPGAs and VHDL programming.

i intended to program the FPGA to read a text file from the PC. this text file holds instructions that control which button activates which LED on the board. the contents of the text file is as shown here:

led_1 : push_A
led_2 : push_C
led_3 : push_B
led_4 : push_D

meaning button A would toggle LED1, button C would toggle LED2 and so on.

i would then check the values of the strings i collected from the textfile and assign them to their respective buttons.

i managed to read the textfile from the PC, but i have been having big problems with the ISE Project Navigator (version 12.1) as the compiler keeps cutting away the strings that i use to store the data. my code is shown here:

Code:
architecture Behavioral of switch_port is

	shared variable copy1: string(6 downto 1):= "      ";
	shared variable copy2: string(6 downto 1):= "      ";
	shared variable copy3: string(6 downto 1):= "      ";
	shared variable copy4: string(6 downto 1):= "      ";
	shared variable gate : boolean := false;
	file textfile : text;
	
begin
 
readprocess:
process(clock)
	
	variable l: line;
	variable s: string(14 downto 1);
	variable b: boolean;

	begin
	
	if clock = '1' and clock'event then	

		if gate = false then --ensure that reading of file is only done once
		
			file_open(textfile, "C:\readme.txt", READ_MODE);
			readline(textfile, l);
			read(l, s, b);
			copy1 := s(6 downto 1); --final result is copy1 = "push_A"
				
			readline(textfile, l);
			read(l, s, b);
			copy2 := s(6 downto 1); --final result is copy1 = "push_C"
				
			readline(textfile, l);
			read(l, s, b);
			copy3 := s(6 downto 1); --final result is copy1 = "push_B"
				
			readline(textfile, l);
			read(l, s, b);
			copy4 := s(6 downto 1); --final result is copy1 = "push_D"
				
			file_close(textfile);
			gate := true;
		
		else --when file is already read, don't read again
		
			if copy1 = "push_A" then
			
				led_1 <= push_A;
			
			elsif copy1 = "push_B" then
			
				led_1 <= push_B;
				
			elsif copy1 = "push_C" then
			
				led_1 <= push_C;
			
			else
				
				led_1 <= push_D;
			
			end if;
			
			if copy2 = "push_A" then
			
				led_2 <= push_A;
			
			elsif copy2 = "push_B" then
			
				led_2 <= push_B;
				
			elsif copy2 = "push_C" then
			
				led_2 <= push_C;
			
			else
				
				led_2 <= push_D;
			
			end if;
			
			if copy3 = "push_A" then
			
				led_3 <= push_A;
			
			elsif copy3 = "push_B" then
			
				led_3 <= push_B;
				
			elsif copy3 = "push_C" then
			
				led_3 <= push_C;
			
			else
				
				led_3 <= push_D;
			
			end if;
			
			if copy4 = "push_A" then
			
				led_4 <= push_A;
			
			elsif copy4 = "push_B" then
			
				led_4 <= push_B;
				
			elsif copy4 = "push_C" then
			
				led_4 <= push_C;
			
			else
				
				led_4 <= push_D;
			
			end if;
		
		end if;

	end if;
	
	end process;
	
end Behavioral;

it works perfectly in the simulator, the respective LEDs toggle on and off whenever the buttons are toggled. but when i compile the program the followinng errors occur:

Code:
WARNING:Xst:1710 - FF/Latch <copy1_6_0> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_6_1> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_6_2> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_6_3> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_6_4> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_6_5> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_6_6> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_6_7> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_4_0> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_4_1> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_4_2> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_4_3> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_4_4> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_4_5> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_4_6> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_4_7> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_5_0> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_5_1> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_5_2> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_5_3> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_5_4> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_5_5> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_5_6> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_5_7> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_3_0> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_3_1> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_3_2> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_3_3> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_3_4> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_3_5> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_3_6> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_3_7> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_1_0> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_1_1> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_1_2> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_1_3> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_1_4> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_1_5> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_1_6> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_1_7> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_2_0> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_2_1> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_2_2> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_2_3> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_2_4> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_2_5> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_2_6> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1895 - Due to other FF/Latch trimming, FF/Latch <copy1_2_7> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process.

i edited the code and text file to read just one character eg 'A' 'B' 'C' instead of "push_A" "push_B" "push_C" and it is able to compile the program. what's the issue with strings here?

what is 'copy1_2_7'...'copy1_1_4'? ...etc? what does the 2_7 or 1_4 etc etc mean?

why are the strings being trimmed when there are valid values being assigned to them?

i have been assigned a more complicated project but i figured that starting small would help my overall understanding, but a simple program like this is already a stumbling block for me :oops: i do not have enough experience in VHDL to know what is the 'correct' way of doing this and would appreciate any help, thanks!
 

In simulation usually your inputs & outputs are connected to the testbench. All connected == no unused signals == no trimming.

When you "compile your program" I assume you mean you are trying to do a place & route? When you do that, there is no testbench for you that connects stuff. You will then have to make sure that these same inputs + outputs that you connected with the testbench .... are now connected to real hardware. So you have to assign input and output pins.

Even if you were not doing place & route... Whatever it is you were doing. The trimming is because ISE found that you did not connect these signals. And if you don't use them, then they are optimized away.
 
  • Like
Reactions: ptjw

    ptjw

    Points: 2
    Helpful Answer Positive Rating
thanks for your reply, my entire code is here:



Code:
library IEEE;
library std;
use std.textio.all;
use IEEE.Numeric_std.ALL;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
library UNISIM;
use UNISIM.VComponents.all;

entity switch_port is
    Port ( clock : in  STD_LOGIC;
           push_A : in  STD_LOGIC; --port K3
			  push_B : in STD_LOGIC; --port H5
			  push_C : in STD_LOGIC; --port L3
			  push_D : in STD_LOGIC; --port H4
           led_1 : out STD_LOGIC;
			  led_2 : out STD_LOGIC;
			  led_3 : out STD_LOGIC;
			  led_4 : out STD_LOGIC);
	  
end switch_port;


architecture Behavioral of switch_port is

	shared variable copy1: string(6 downto 1):= "      ";
	shared variable copy2: string(6 downto 1):= "      ";
	shared variable copy3: string(6 downto 1):= "      ";
	shared variable copy4: string(6 downto 1):= "      ";
	shared variable gate : boolean := false;
	file textfile : text;
	
begin
 
readprocess:
process(clock)
	
	variable l: line;
	variable s: string(14 downto 1);
	variable b: boolean;

	begin
	
	if clock = '1' and clock'event then	

		if gate = false then
		
			file_open(textfile, "C:\readme.txt", READ_MODE);
			readline(textfile, l);
			read(l, s, b);
			copy1 := s(6 downto 1);
				
			readline(textfile, l);
			read(l, s, b);
			copy2 := s(6 downto 1);
				
			readline(textfile, l);
			read(l, s, b);
			copy3 := s(6 downto 1);
				
			readline(textfile, l);
			read(l, s, b);
			copy4 := s(6 downto 1);
				
			file_close(textfile);
			gate := true;
		
		else
		
			if copy1 = "push_A" then
			
				led_1 <= push_A;
			
			elsif copy1 = "push_B" then
			
				led_1 <= push_B;
				
			elsif copy1 = "push_C" then
			
				led_1 <= push_C;
			
			else
				
				led_1 <= push_D;
			
			end if;
			
			if copy2 = "push_A" then
			
				led_2 <= push_A;
			
			elsif copy2 = "push_B" then
			
				led_2 <= push_B;
				
			elsif copy2 = "push_C" then
			
				led_2 <= push_C;
			
			else
				
				led_2 <= push_D;
			
			end if;
			
			if copy3 = "push_A" then
			
				led_3 <= push_A;
			
			elsif copy3 = "push_B" then
			
				led_3 <= push_B;
				
			elsif copy3 = "push_C" then
			
				led_3 <= push_C;
			
			else
				
				led_3 <= push_D;
			
			end if;
			
			if copy4 = "push_A" then
			
				led_4 <= push_A;
			
			elsif copy4 = "push_B" then
			
				led_4 <= push_B;
				
			elsif copy4 = "push_C" then
			
				led_4 <= push_C;
			
			else
				
				led_4 <= push_D;
			
			end if;
		
		end if;

	end if;
	
	end process;
	
end Behavioral;


yes i clicked on 'implement design' which would then run place and route. i don't understand the concept of 'connecting signals'. i have declared both input and output ports with the buttons being inputs and the outputs being the LEDs. the main problem i infer from the errors below is that first of all the strings are being trimmed away, then because the strings do not contain useful information, the ports are trimmed away because they are never activated.

i 'used' the strings by storing information in them, and then referring to them afterwards, but the error "FF/Latch <copy1_6_0> (without init value) has a constant value of 0 in block <switch_port>. This FF/Latch will be trimmed during the optimization process" says it has a constant value of 0, what does this mean?

thanks
 

strings are not appropriate for synthesis, and neither is File IO. THese two things are meant only for simulation. The strings are not even an output from the entity. Anything that ISE sees as useless, it will trim.

Forget all about strings and File IO - think about the cuircuit you want to create - draw it on paper and then write the VHDL. VHDL is NOT a programming language.
 
  • Like
Reactions: ptjw

    ptjw

    Points: 2
    Helpful Answer Positive Rating
oh bugger..

i have actually been tasked with a project that uses a Spartan 3A that is linked to a SD card reader via SPI interface. what i need to do is basically the same idea as the project above but more complex:

the SD card stores information like which button operates which LED, and the buttons and LEDs can be switched around just by changing the data of the textfile in the SD card. like the program and textfile above, the idea is to read the textfile and reroute the signals accordingly for example if the textfile says:

"port 1 (input) to port 4 (output)"

then the signal incoming at port 1 will be sent to the output at port 4, and if i change the textfile to: "port1 (input) to port 3 (output)" then the signal will be rerouted accordingly.

i had originally intended to retrieve the data from the SD card in SPI mode (which would give me the data in hex) and sort the data from there. do you have any advice on how i can retrieve and work with data from a textfile on a SD card?
 

By implementing an SPI core that is able to read a file from a file system? If you have to do that and learn vhdl then I hope you have some spare time... ;)

Are you allowed to treat the SD card as a block device? Are you allowed to cheat and tell your design where on the SD to start reading? Regardless, I think that on opencores.org there is something for reading SD cards.
 

i assume that i am allowed to tell my design where to start reading, i have studied the SPI protocol and the code on this site i found https://stevenmerrifield.com/tools/sd.vhd makes the most sense to me so far.

thank you, i will take a look at opencores.org...i figured that SDcards are used by so many devices that it would've been pretty common but i couldn't find anything that is of help to me so far

sadly i thought this wouldn't be as complicated as it is now, but i guess i need to start learning, C/C++ seems so much easier now :lol:
 

Well, if it makes you feel any better ... I find C/C++ a lot easier than getting the xilinx tools to do what I want. :p
 

I've be thinking about this problem for some time but I can't figure a solution..if strings don't work in terms of hardware then what method can I use to retrieve data from a SDcard? if I put a text file inside a SDcard and request the data through SPI, wouldn't the data I'm receiving be the text in the form of hex code (but essentially still text/strings)

sorry but I'm still new at VHDL, I'm doing this with only previous experiences in C++ so any help would be great!
 

you'd be receiving binary data, not text. You have to remember in real hardware you only ever see raw data. a string is just a concept of a way to visualise raw data.
 
  • Like
Reactions: ptjw

    ptjw

    Points: 2
    Helpful Answer Positive Rating
i have gotten over the use of strings and have made progress, so thanks to all for the help...but i do have another problem:

as mentioned before, i used the code from this website to get a general idea of how to implement SPI --> https://stevenmerrifield.com/tools/sd.vhd

Code:
type states is (
	RST,
	INIT,
	CMD0,
	CMD55,
	CMD41,
	POLL_CMD,
  
	IDLE,	-- wait for read or write pulse
	READ_BLOCK,
	READ_BLOCK_WAIT,
	READ_BLOCK_DATA,
	READ_BLOCK_CRC,
	SEND_CMD,
	RECEIVE_BYTE_WAIT,
	RECEIVE_BYTE,
	WRITE_BLOCK_CMD,
	WRITE_BLOCK_INIT,		-- initialise write command
	WRITE_BLOCK_DATA,		-- loop through all data bytes
	WRITE_BLOCK_BYTE,		-- send one byte
	WRITE_BLOCK_WAIT		-- wait until not busy
);



signal state, return_state : states;

i declared state and return_state exactly as shown in the code above and upon synthesizing i get these warnings:

Code:
WARNING:Xst:1293 - FF/Latch <return_state_1> has a constant value of 0 in block <Main>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <return_state_2> has a constant value of 0 in block <Main>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <return_state_7> has a constant value of 0 in block <Main>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <return_state_11> has a constant value of 0 in block <Main>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <return_state_12> has a constant value of 0 in block <Main>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <return_state_13> has a constant value of 0 in block <Main>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1293 - FF/Latch <return_state_1> has a constant value of 0 in block <Main>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <return_state_2> has a constant value of 0 in block <Main>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <return_state_7> has a constant value of 0 in block <Main>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <return_state_11> has a constant value of 0 in block <Main>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <return_state_12> has a constant value of 0 in block <Main>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <return_state_13> has a constant value of 0 in block <Main>. This FF/Latch will be trimmed during the optimization process.

what does return_state_XX refer to? it would make sense if return_state was an array and XX would refer to which value in the array but return_state has been declared as state and can only hold values that have already been stated at the top of the code.

state is also declared alongside return_state but there are no warnings regarding state...i synthesized the same code as used in the stevenmerrifield website. so why is return_state causing problems and not state? what is the ISE Design Suite trying to tell me here? :|

thanks for you help! :smile:
 

If XST is like Quartus (from altera) statemachines with more than 5 starte will be encoded 1-hot (unless specified). So the state type is converted to a signal with 1 bit per state. The "XX" probably refers to a specific state (there should be 19 bits for your state encoding). So it has deduced that half of your states have no logic driving them, so they are redundant and removed.
 
  • Like
Reactions: ptjw

    ptjw

    Points: 2
    Helpful Answer Positive Rating
oh ho ho ok i only saw the obvious only after your post...state runs through all the states available at least once while return_state does not and they are removed because it will never be at that value...awesome...thanks! helpful post awarded to you!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top