Interpret a VHDL statement within a serial to paralell port

N

nobody

Guest
First, thank you for taking the time to consider the questions I have not answered.
I am working on a 32 bit serial to 32 bit parallel port which reads from an ADC. Currently looking to find a better solution, and I searched for predefined vhdl module with little success. I stumbled upon Macros, SR16CE, which utilize primitives but they seem to be schematic oriented and not available inside the ISE 8.2i, windows xp os.

Question: Do common VHDL constructs exist in some library within the Xilinx folder file structure?

Stumbling onto some help files within Xilinx website,http://www.csit-sun.pub.ro/courses/Masterat/Xilinx%20Synthesis%20Technology/toolbox.xilinx.com/docsan/xilinx4/data/docs/xst/hdlcode8.html, I found what I think I was looking for, however I need some help interpreting the VHDL statement that does everything, [line 13]:

8-bit Shift-Left Register with Positive-Edge Clock, Serial In, and Parallel Out
Note For this example XST will infer SRL16.

1.library ieee;
2.use ieee.std_logic_1164.all;

3.entity shift is
4. port(C, SI : in std_logic;
5. PO : out std_logic_vector(7 downto 0));
6.end shift;
7.architecture archi of shift is
8. signal tmp: std_logic_vector(7 downto 0);
9. begin
10. process (C)
11. begin
12. if (C'event and C='1') then
13. tmp <= tmp(6 downto 0)& SI;
14. end if;
15. end process;
16. PO <= tmp;
17.end archi;

Question:How does line 13 seem to do so much?
 
On Friday, March 27, 2015 at 5:14:44 PM UTC-5, nobody wrote:
First, thank you for taking the time to consider the questions I have not answered.
I am working on a 32 bit serial to 32 bit parallel port which reads from an ADC. Currently looking to find a better solution, and I searched for predefined vhdl module with little success. I stumbled upon Macros, SR16CE, which utilize primitives but they seem to be schematic oriented and not available inside the ISE 8.2i, windows xp os.

Question: Do common VHDL constructs exist in some library within the Xilinx folder file structure?

Stumbling onto some help files within Xilinx website,http://www.csit-sun.pub.ro/courses/Masterat/Xilinx%20Synthesis%20Technology/toolbox.xilinx.com/docsan/xilinx4/data/docs/xst/hdlcode8.html, I found what I think I was looking for, however I need some help interpreting the VHDL statement that does everything, [line 13]:

8-bit Shift-Left Register with Positive-Edge Clock, Serial In, and Parallel Out
Note For this example XST will infer SRL16.

1.library ieee;
2.use ieee.std_logic_1164.all;

3.entity shift is
4. port(C, SI : in std_logic;
5. PO : out std_logic_vector(7 downto 0));
6.end shift;
7.architecture archi of shift is
8. signal tmp: std_logic_vector(7 downto 0);
9. begin
10. process (C)
11. begin
12. if (C'event and C='1') then
13. tmp <= tmp(6 downto 0)& SI;
14. end if;
15. end process;
16. PO <= tmp;
17.end archi;

Question:How does line 13 seem to do so much?

The "&" symbol in Line 13 is the concatenation operator. Line 13 performs the shift by concatenating the lower 7 bits of the shift register with the serial input, SI. This results in SI becoming bit 0 of tmp and bit 7 of tmp being discarded. Hope this helps.

Darol Klawetter
 
On 3/27/2015 7:22 PM, darol.klawetter@gmail.com wrote:
On Friday, March 27, 2015 at 5:14:44 PM UTC-5, nobody wrote:
First, thank you for taking the time to consider the questions I have not answered.
I am working on a 32 bit serial to 32 bit parallel port which reads from an ADC. Currently looking to find a better solution, and I searched for predefined vhdl module with little success. I stumbled upon Macros, SR16CE, which utilize primitives but they seem to be schematic oriented and not available inside the ISE 8.2i, windows xp os.

Question: Do common VHDL constructs exist in some library within the Xilinx folder file structure?

Stumbling onto some help files within Xilinx website,http://www.csit-sun.pub.ro/courses/Masterat/Xilinx%20Synthesis%20Technology/toolbox.xilinx.com/docsan/xilinx4/data/docs/xst/hdlcode8.html, I found what I think I was looking for, however I need some help interpreting the VHDL statement that does everything, [line 13]:

8-bit Shift-Left Register with Positive-Edge Clock, Serial In, and Parallel Out
Note For this example XST will infer SRL16.

1.library ieee;
2.use ieee.std_logic_1164.all;

3.entity shift is
4. port(C, SI : in std_logic;
5. PO : out std_logic_vector(7 downto 0));
6.end shift;
7.architecture archi of shift is
8. signal tmp: std_logic_vector(7 downto 0);
9. begin
10. process (C)
11. begin
12. if (C'event and C='1') then
13. tmp <= tmp(6 downto 0)& SI;
14. end if;
15. end process;
16. PO <= tmp;
17.end archi;

Question:How does line 13 seem to do so much?

The "&" symbol in Line 13 is the concatenation operator. Line 13 performs the shift by concatenating the lower 7 bits of the shift register with the serial input, SI. This results in SI becoming bit 0 of tmp and bit 7 of tmp being discarded. Hope this helps.

Yes, that is a fairly straightforward expression of the shift function.
The question is whether your tool will be able to infer the use of two
SRL16s. Actually, I don't think an SRL16 is at all appropriate for a
serial to parallel converter since it doesn't have a parallel output.
The SRL16 is serial buffer, 1 bit in and 1 bit out.

If you look at the various sections on this page they list examples some
of which say they *will* infer SRL16s and some say they *will not* infer
SRL16s. I think they made a mistake and left out the *not* for the
section showing this code. This is *not* Xilinx vetted info. It is a
third party source with unknown credentials. I believe any of the code
shown involving parallel input or output will not be inferred using SRL16s.

Look at this app note and I think you will see the limitation of the
SRL16s.

http://www.xilinx.com/support/documentation/application_notes/xapp465.pdf

So the above code will work just fine. It just won't, and in fact,
*can't* use an SRL16.

Someone please correct me if I am wrong.

--

Rick
 
On Friday, March 27, 2015 at 7:23:57 PM UTC-7, rickman wrote:
On 3/27/2015 7:22 PM, darol.klawetter@gmail.com wrote:
On Friday, March 27, 2015 at 5:14:44 PM UTC-5, nobody wrote:
First, thank you for taking the time to consider the questions I have not answered.
I am working on a 32 bit serial to 32 bit parallel port which reads from an ADC. Currently looking to find a better solution, and I searched for predefined vhdl module with little success. I stumbled upon Macros, SR16CE, which utilize primitives but they seem to be schematic oriented and not available inside the ISE 8.2i, windows xp os.

Question: Do common VHDL constructs exist in some library within the Xilinx folder file structure?

Stumbling onto some help files within Xilinx website,http://www.csit-sun.pub.ro/courses/Masterat/Xilinx%20Synthesis%20Technology/toolbox.xilinx.com/docsan/xilinx4/data/docs/xst/hdlcode8.html, I found what I think I was looking for, however I need some help interpreting the VHDL statement that does everything, [line 13]:

8-bit Shift-Left Register with Positive-Edge Clock, Serial In, and Parallel Out
Note For this example XST will infer SRL16.

1.library ieee;
2.use ieee.std_logic_1164.all;

3.entity shift is
4. port(C, SI : in std_logic;
5. PO : out std_logic_vector(7 downto 0));
6.end shift;
7.architecture archi of shift is
8. signal tmp: std_logic_vector(7 downto 0);
9. begin
10. process (C)
11. begin
12. if (C'event and C='1') then
13. tmp <= tmp(6 downto 0)& SI;
14. end if;
15. end process;
16. PO <= tmp;
17.end archi;

Question:How does line 13 seem to do so much?

The "&" symbol in Line 13 is the concatenation operator. Line 13 performs the shift by concatenating the lower 7 bits of the shift register with the serial input, SI. This results in SI becoming bit 0 of tmp and bit 7 of tmp being discarded. Hope this helps.

Yes, that is a fairly straightforward expression of the shift function.
The question is whether your tool will be able to infer the use of two
SRL16s. Actually, I don't think an SRL16 is at all appropriate for a
serial to parallel converter since it doesn't have a parallel output.
The SRL16 is serial buffer, 1 bit in and 1 bit out.

If you look at the various sections on this page they list examples some
of which say they *will* infer SRL16s and some say they *will not* infer
SRL16s. I think they made a mistake and left out the *not* for the
section showing this code. This is *not* Xilinx vetted info. It is a
third party source with unknown credentials. I believe any of the code
shown involving parallel input or output will not be inferred using SRL16s.

Look at this app note and I think you will see the limitation of the
SRL16s.

http://www.xilinx.com/support/documentation/application_notes/xapp465.pdf

So the above code will work just fine. It just won't, and in fact,
*can't* use an SRL16.

Someone please correct me if I am wrong.

--

Rick

Thank you for you time. I had similar thoughts having read xapp465. I guess that still leaves me with needing a helpful solution toward utilizing a serial to parallel hardware, which would seem very common and tucked away in some library somewhere. I came across the use of macros, but are based on graphical symbols, schematics, and not VHDL. The macors seemed to be based on the SR16CE but I have not been able to find hide nor hair of such a beast.. Thank you!
 
On Monday, March 30, 2015 at 9:01:28 AM UTC-7, nobody wrote:
On Friday, March 27, 2015 at 7:23:57 PM UTC-7, rickman wrote:
On 3/27/2015 7:22 PM, darol.klawetter@gmail.com wrote:
On Friday, March 27, 2015 at 5:14:44 PM UTC-5, nobody wrote:
First, thank you for taking the time to consider the questions I have not answered.
I am working on a 32 bit serial to 32 bit parallel port which reads from an ADC. Currently looking to find a better solution, and I searched for predefined vhdl module with little success. I stumbled upon Macros, SR16CE, which utilize primitives but they seem to be schematic oriented and not available inside the ISE 8.2i, windows xp os.

Question: Do common VHDL constructs exist in some library within the Xilinx folder file structure?

Stumbling onto some help files within Xilinx website,http://www.csit-sun.pub.ro/courses/Masterat/Xilinx%20Synthesis%20Technology/toolbox.xilinx..com/docsan/xilinx4/data/docs/xst/hdlcode8.html, I found what I think I was looking for, however I need some help interpreting the VHDL statement that does everything, [line 13]:

8-bit Shift-Left Register with Positive-Edge Clock, Serial In, and Parallel Out
Note For this example XST will infer SRL16.

1.library ieee;
2.use ieee.std_logic_1164.all;

3.entity shift is
4. port(C, SI : in std_logic;
5. PO : out std_logic_vector(7 downto 0));
6.end shift;
7.architecture archi of shift is
8. signal tmp: std_logic_vector(7 downto 0);
9. begin
10. process (C)
11. begin
12. if (C'event and C='1') then
13. tmp <= tmp(6 downto 0)& SI;
14. end if;
15. end process;
16. PO <= tmp;
17.end archi;

Question:How does line 13 seem to do so much?

The "&" symbol in Line 13 is the concatenation operator. Line 13 performs the shift by concatenating the lower 7 bits of the shift register with the serial input, SI. This results in SI becoming bit 0 of tmp and bit 7 of tmp being discarded. Hope this helps.

Darol,

Thank you, that was helpful!

Cy
 
rickman <gnuarm@gmail.com> wrote:
On 3/27/2015 7:22 PM, darol.klawetter@gmail.com wrote:
(snip)

I am working on a 32 bit serial to 32 bit parallel port which
reads from an ADC.
(snip)

Yes, that is a fairly straightforward expression of the shift function.
The question is whether your tool will be able to infer the use of two
SRL16s. Actually, I don't think an SRL16 is at all appropriate for a
serial to parallel converter since it doesn't have a parallel output.
The SRL16 is serial buffer, 1 bit in and 1 bit out.

Yes, but I think you can select which bit it is.

It will at least make constant length shift registers with lengths
other than 16.

The logic is similar to the usual LUT logic, but with the ability
to shift the bits in the LUT (RAM).

If you look at the various sections on this page they list examples some
of which say they *will* infer SRL16s and some say they *will not* infer
SRL16s. I think they made a mistake and left out the *not* for the
section showing this code. This is *not* Xilinx vetted info. It is a
third party source with unknown credentials. I believe any of the code
shown involving parallel input or output will not be inferred using SRL16s.

I am not so good at figuring out Xilinx primitives, but I did figure
out how to use a clock generator as a Xilinx primitive.

I think you should be able to generate a shift register, counter, and
multiplexer, to shift and then select which bit to send out.
It might take primitives to do that, though.

-- glen
 
On 3/30/2015 12:01 PM, nobody wrote:
On Friday, March 27, 2015 at 7:23:57 PM UTC-7, rickman wrote:
On 3/27/2015 7:22 PM, darol.klawetter@gmail.com wrote:
On Friday, March 27, 2015 at 5:14:44 PM UTC-5, nobody wrote:
First, thank you for taking the time to consider the questions I have not answered.
I am working on a 32 bit serial to 32 bit parallel port which reads from an ADC. Currently looking to find a better solution, and I searched for predefined vhdl module with little success. I stumbled upon Macros, SR16CE, which utilize primitives but they seem to be schematic oriented and not available inside the ISE 8.2i, windows xp os.

Question: Do common VHDL constructs exist in some library within the Xilinx folder file structure?

Stumbling onto some help files within Xilinx website,http://www.csit-sun.pub.ro/courses/Masterat/Xilinx%20Synthesis%20Technology/toolbox.xilinx.com/docsan/xilinx4/data/docs/xst/hdlcode8.html, I found what I think I was looking for, however I need some help interpreting the VHDL statement that does everything, [line 13]:

8-bit Shift-Left Register with Positive-Edge Clock, Serial In, and Parallel Out
Note For this example XST will infer SRL16.

1.library ieee;
2.use ieee.std_logic_1164.all;

3.entity shift is
4. port(C, SI : in std_logic;
5. PO : out std_logic_vector(7 downto 0));
6.end shift;
7.architecture archi of shift is
8. signal tmp: std_logic_vector(7 downto 0);
9. begin
10. process (C)
11. begin
12. if (C'event and C='1') then
13. tmp <= tmp(6 downto 0)& SI;
14. end if;
15. end process;
16. PO <= tmp;
17.end archi;

Question:How does line 13 seem to do so much?

The "&" symbol in Line 13 is the concatenation operator. Line 13 performs the shift by concatenating the lower 7 bits of the shift register with the serial input, SI. This results in SI becoming bit 0 of tmp and bit 7 of tmp being discarded. Hope this helps.

Yes, that is a fairly straightforward expression of the shift function.
The question is whether your tool will be able to infer the use of two
SRL16s. Actually, I don't think an SRL16 is at all appropriate for a
serial to parallel converter since it doesn't have a parallel output.
The SRL16 is serial buffer, 1 bit in and 1 bit out.

If you look at the various sections on this page they list examples some
of which say they *will* infer SRL16s and some say they *will not* infer
SRL16s. I think they made a mistake and left out the *not* for the
section showing this code. This is *not* Xilinx vetted info. It is a
third party source with unknown credentials. I believe any of the code
shown involving parallel input or output will not be inferred using SRL16s.

Look at this app note and I think you will see the limitation of the
SRL16s.

http://www.xilinx.com/support/documentation/application_notes/xapp465.pdf

So the above code will work just fine. It just won't, and in fact,
*can't* use an SRL16.

Someone please correct me if I am wrong.

--

Rick

Thank you for you time. I had similar thoughts having read xapp465. I guess that still leaves me with needing a helpful solution toward utilizing a serial to parallel hardware, which would seem very common and tucked away in some library somewhere. I came across the use of macros, but are based on graphical symbols, schematics, and not VHDL. The macors seemed to be based on the SR16CE but I have not been able to find hide nor hair of such a beast.. Thank you!

I'm not sure what you are trying to do. The code you have above will do
the job of a serial to parallel shift register. Why do you need to
worry about which primitives get used in the FPGA?

--

Rick
 

Welcome to EDABoard.com

Sponsor

Back
Top