element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
FPGA
  • Technologies
  • More
FPGA
Blog The Art of FPGA Design - Post 37
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join FPGA to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: fpgaguru
  • Date Created: 3 Oct 2021 7:29 PM Date Created
  • Views 2286 views
  • Likes 2 likes
  • Comments 2 comments
  • fpga_featured
  • xilinx
  • vhdl
  • guest writer
Related
Recommended

The Art of FPGA Design - Post 37

fpgaguru
fpgaguru
3 Oct 2021

Recent Advances in Vivado VHDL-2008 Support

 

Previous posts in this blog were made in the 2018-2019 period. Some of the issues presented were an attempt to work around VHDL-2008 support limitations in Vivado at that point in time. Since then, significant progress has been made in that direction and rather than modifying those old posts I will add a few to this otherwise closed season of my blog to bring the subject up to date.

 

Good VHDL-2008 support is important for designers using an HDL flow, including those who prefer the Verilog or System Verilog HDL language because Vivado lets you freely mix VHDL and Verilog HDL modules in the same design. While the two main HDL languages are more or less equivalent, there are useful language features and design techniques which exist in VHDL but do not have a System Verilog equivalent. As a Verilog designer, you can still take advantage of these nice VHDL language features by using them in lower level VHDL-2008 design hierarchy modules, while still coding the majority of your design in your preferred HDL language.

 

In particular, the unconstrained array ports and especially unconstrained arrays of unconstrained arrays and records, which is a VHDL-2008 feature, do not have System Verilog equivalents and are very useful, especially for DSP type applications. The problem with Vivado at the time when this blog was started was that VHDL-2008 support was relatively limited.

 

VHDL-2008 has a new native type called SFIXED, which is an arbitrary precision fixed point type and you can define generic modules with ports of unconstrained SFIXED type, but more importantly, you can define CFIXED records with real and imaginary fields that are unconstrained SFIXED and then even unconstrained arrays of these two types, SFIXED_VECTOR and CFIXED_VECTOR:

 

  type SFIXED is array(INTEGER range <>) of STD_LOGIC;     – arbitrary precision fixed point signed number, like SIGNED but lower bound can be negative
 
type CFIXED is record RE,IM:SFIXED; end record;          – arbitrary precision fixed point complex signed number - not valid in VHDL-93!

  type SFIXED_VECTOR is array(INTEGER range <>) of SFIXED; – unconstrained array of SFIXED - VHDL-2008 only feature
 
type CFIXED_VECTOR is array(INTEGER range <>) of CFIXED; – unconstrained array of CFIXED - VHDL-2008 only feature
 
type CFIXED_MATRIX is array(INTEGER range <>) of CFIXED_VECTOR; – unconstrained array of CFIXED_VECTOR - VHDL-2008 only feature

 

Unfortunately, these VHDL-2008 features had limited support in previous versions of the Xilinx FPGA design tool Vivado. Support for unconstrained arrays of unconstrained records and arrays exists in Vivado Synthesis since 2018 but not through the predefined VHDL-2008 SFIXED type, you had to use instead an equivalent user defined type with the same name, which is the aproach I used in previous posts of this blog. However, starting with Vivado 2020.2 the VHDL-2008 fixed_generic_pkg generic package which introduces the SFIXED type is finally supported for Synthesis and even more importantly, the same feature will also work in Vivado Simulation starting with Vivado 2021.2, which will be released in October 2021. This means that you will no longer need a third part HDL simulator with good VHDL-2008 support like QuestaSim, you will be finally able to both simulate and implement designs using this feature within Vivado.

 

This is especially good news for students and makers since Vivado has a free edition version and you get a good VHDL-2008 simulator without any size limitations for free, which means you can learn modern HDL design with no initial starting cost.

 

In the next few posts I will show how this new feature works in Vivado 2021.2 and give a few useful design examples.

 

Back to the top: The Art of FPGA Design

  • Sign in to reply
Parents
  • dubya
    dubya over 3 years ago

    posting this comment on the new vhdl 2008 in Vivado 2021.2 announcement but my question is really about the prior 2018ish work.

     

    In post 21 with the behavioral FIR model here:

    https://www.element14.com/community/groups/fpga-group/blog/2018/11/27/the-art-of-fpga-design-post-21

     

    A function "element()" is used in this context:

               B<=ELEMENT(CI,K,N);         -- register for the coefficient inputs

     

    It takes a sfixed vector and returns an sfixed.

     

    A few related questions:

    1) I can't find this function defined in the other blogs. Maybe im missing it

    2) I'm not sure why we need a function to index an array. Wouldn't CI(K) work? (Assuming vhdl 2008 support)

     

    3) I don't understand the second argument "N". Why does indexing the vector need to know the length of the array of vectors?

     

    Jancumps made a very useful gist here:

    https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fgist.github.com%2Fjancumps%2F622591b9a9a74c24e081a8b7407d7a1a

     

    Of the types package. I looked there for a definition of Element () didn't find one.

     

    Then I tried to write one myself and simulate it with xsim 2021.2. I get the hilarious error that I can't convert an sfixed vector to type sfixed.

     

    That's funny to me because that's what the function is trying to do. Likely my poor understanding of the 3rd argument N has something to do with it.

     

     

    Thanks,

    Newbie

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • dubya
    dubya over 3 years ago

    posting this comment on the new vhdl 2008 in Vivado 2021.2 announcement but my question is really about the prior 2018ish work.

     

    In post 21 with the behavioral FIR model here:

    https://www.element14.com/community/groups/fpga-group/blog/2018/11/27/the-art-of-fpga-design-post-21

     

    A function "element()" is used in this context:

               B<=ELEMENT(CI,K,N);         -- register for the coefficient inputs

     

    It takes a sfixed vector and returns an sfixed.

     

    A few related questions:

    1) I can't find this function defined in the other blogs. Maybe im missing it

    2) I'm not sure why we need a function to index an array. Wouldn't CI(K) work? (Assuming vhdl 2008 support)

     

    3) I don't understand the second argument "N". Why does indexing the vector need to know the length of the array of vectors?

     

    Jancumps made a very useful gist here:

    https://www.element14.com/community/external-link.jspa?url=https%3A%2F%2Fgist.github.com%2Fjancumps%2F622591b9a9a74c24e081a8b7407d7a1a

     

    Of the types package. I looked there for a definition of Element () didn't find one.

     

    Then I tried to write one myself and simulate it with xsim 2021.2. I get the hilarious error that I can't convert an sfixed vector to type sfixed.

     

    That's funny to me because that's what the function is trying to do. Likely my poor understanding of the 3rd argument N has something to do with it.

     

     

    Thanks,

    Newbie

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • fpgaguru
    fpgaguru over 3 years ago in reply to dubya

    Hi,

     

    The main goal here is to use types for signals and component ports that are unconstrained arrays and build reusable designs that work with any arbitrary range. VHDL-93 has the (range <>) construct to express such things but you cannot have unconstrained arrays of unconstrained arrays and records, which would be very useful for signal processing applications, think vectors of arbitrary size of complex values, with the real and imaginary fields an arbitrary unconstrained array of STD_LOGIC. This feature exists in VHDL-2008 but it took time for the synthesis and especially the simulation tools in Vivado to implement it.

     

    The ELEMENT() function is an attempt to fake this multiple unconstrained feature using VHDL-93 syntax, you would stitch the real and imaginary parts together then the complex elements together in a single VHDL-93 unconstrained array of STD_LOGIC and use these helper functions to access an element of the array. The function needs to know the actual size of the array to be able to slice an element, which is what the N argument is.

     

    Fortunately, these cumbersome workarounds are no longer required. Since 2018.2 I think Vivado synthesis supports well this VHDL-2008 feature, and since 2021.2, which should be released this month, Vivado simulator will do too. I suggest you ignore the old code and try the VHDL-2008 constructs directly in Vivado 2021.2. I plan to add a couple of posts to the old season one blog with code examples on how to do that.

     

    Catalin

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube