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
Forum Connecting Verilog to Synthesis
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join FPGA to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 12 replies
  • Answers 2 answers
  • Subscribers 546 subscribers
  • Views 2847 views
  • Users 0 members are here
Related

Connecting Verilog to Synthesis

mraureliusr
mraureliusr over 11 years ago

Hey everyone! Wish I had seen this group earlier.

 

I'm hoping there's a few here who are familiar with the Xilinx ISE. I'm finally making a concerted effort to learn Verilog and this time around I'm doing well. I'm grasping the language concepts well, and am enjoying the book I picked up from the local University library (public library is a bit short on HDL books!) called "Verilog for Digital Design" written by Frank Vahid and Roman Lysecky. Make sure to check for the 2002 edition, there are older versions as well. This book is the perfect blend of theory and practical code writing.

 

Anyway, I wanted to try implementing a simple design of my own, essentially recreating the functionality of four 74193 up/down binary counters. The inputs are four buttons, up, down, load and store. The load and store buttons control signals for a later stage of the design.

 

I wrote the counter module, then created a top level module and instantiated the     counter module. I simulated it with a simple test bench and it worked!! Amazing!

 

However, now I'm trying to implement it in my Spartan-3E FPGA and I'm having trouble figuring out the hierarchy of a typical design. Clearly the top level module interfaces with the actual pins, and then passes these states to the instantiated module. But how do I pick which pins connect to the top level module? I see that PlanAhead seems to implement this stage of the design but I'm confused on how to put it all together. I'm also having trouble connecting the counter module ports to the top level module. It keeps giving me errors for the output bus, saying something like it's not a proper lvalue? The counter module has the counter output declared as an output reg[15:0] ... is that incorrect? The top level module also has the actual output declared as an output reg, is it improper to commect these types together? I figured within the counter module that the output should be a reg ad not a wire, because it needs to hold its value. Plus the output needs to be manipulated directly and it seems a reg was the easiest way to do this


Perhaps these questions will be answered later in the book but the ISE/Xilinx specific problems won't be addressed as the author uses different software and never directly talks about specific brands. He does focus on both simulation and synthesis though, which is what I was looking for. Most books on Verilog place a heavy focus on simulation, and while I've discovered how useful simulation is, I have this Xilinx dev board that I want to play/learn with!


Thanks everyone for reading all that. image Will be happy to share more as I learn more. If it helps I can post my code here.

  • Sign in to reply
  • Cancel

Top Replies

  • johnbeetem
    johnbeetem over 11 years ago +1 suggested
    I've never used PlanAhead. I always use a User Constraint File (.ucf) to define the pinout. The easiest way is to start with a working .ucf as a template, and then modify it. For example, here is the UCF…
Parents
  • johnbeetem
    0 johnbeetem over 11 years ago

    I've never used PlanAhead.  I always use a User Constraint File (.ucf) to define the pinout.  The easiest way is to start with a working .ucf as a template, and then modify it.  For example, here is the UCF file for the Papilio One FPGA board from Gadget Factory: http://forum.gadgetfactory.net/index.php?/files/file/2-papilio-one-generic-ucf/

     

    Here's a simple 4-bit up-counter:

    module UpCounter(Pclk, K);

    input    Pclk;            // 32 MHz Papilio clock.

    output    [3:0] K;        // 4-bit counter;

    reg        [3:0] K;

     

    always @(posedge Pclk)

            K <= K + 1;

    endmodule 

     

    This is the root module, and the pins Pclk and K[3:0] are the external pins.

     

    Once I have this in a .v file, I create a UCF with the same module name, UpCounter.ucf.

    Here are the relevant lines:

     

    NET Pclk  LOC="P89"  | IOSTANDARD=LVCMOS33 | PERIOD=31.25ns;

    NET K<0> LOC="P58" | IOSTANDARD=LVTTL;

    NET K<1> LOC="P41" | IOSTANDARD=LVTTL;

    NET K<2> LOC="P34" | IOSTANDARD=LVTTL;

    NET K<3> LOC="P25" | IOSTANDARD=LVTTL;

     

    I use the notation K<i> to reference bit i of bus K.

     

    I typically use ISE Webpack 12.4, with XST for synthesis.

     

    ISE has a tool for interactively editing the pinout, but I find .ucf quicker since you can use standard text editor copy/paste and replacement operations.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • michaelkellett
    0 michaelkellett over 11 years ago in reply to johnbeetem

    @ Alexander - good advice from John - I'm going to add some lateral comments.

     

    I haven't used Xilinx tools for years having moved to Lattice (mainly because I see them as being long term interested in low cost FPGAs and smaller users) - Lattice do have quite a few low cost (and low power) parts in resaonable packages (and some really nice low power parts in difficult-to-use-at-home BGA packages.)

    The Lattice toolset includes Aldec HDL with a nice block diagram editor which takes care of all the awful tedium of connecting inputs and outputs of blocks.

     

    Finally - before you invest too much time in Verilog at least take a look at VHDL - I won't say that one is better than the other but I certainly find that VHDL suits my way of working far better than Verilog does. (I think John finds the opposite image)

     

    MK

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Reply
  • michaelkellett
    0 michaelkellett over 11 years ago in reply to johnbeetem

    @ Alexander - good advice from John - I'm going to add some lateral comments.

     

    I haven't used Xilinx tools for years having moved to Lattice (mainly because I see them as being long term interested in low cost FPGAs and smaller users) - Lattice do have quite a few low cost (and low power) parts in resaonable packages (and some really nice low power parts in difficult-to-use-at-home BGA packages.)

    The Lattice toolset includes Aldec HDL with a nice block diagram editor which takes care of all the awful tedium of connecting inputs and outputs of blocks.

     

    Finally - before you invest too much time in Verilog at least take a look at VHDL - I won't say that one is better than the other but I certainly find that VHDL suits my way of working far better than Verilog does. (I think John finds the opposite image)

     

    MK

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Children
No Data
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