• Home
  • Products
    • Papilio FPGA
    • Arcade MegaWing
    • RetroCade MegaWing
    • LogicStart MegaWing
    • Logic Sniffer
    • Papilio Wings
  • Store
    • Gadget Factory Store
    • India Store
    • Distributers
  • Wikis
    • Papilio Wiki
    • Arcade Wiki
    • RetroCade Wiki
    • Logic Sniffer Wiki
  • Forum
  • Showcase
  • Downloads
  • Source Code
  • Home
  • Products
    • Papilio FPGA
    • Arcade MegaWing
    • RetroCade MegaWing
    • LogicStart MegaWing
    • Logic Sniffer
    • Papilio Wings
  • Store
    • Gadget Factory Store
    • India Store
    • Distributers
  • Wikis
    • Papilio Wiki
    • Arcade Wiki
    • RetroCade Wiki
    • Logic Sniffer Wiki
  • Forum
  • Showcase
  • Downloads
  • Source Code
Previous Next

DesignLab Libraries – Library QuickStart

Posted by: Jack Gassett , April 3, 2015

Get started with making your own libraries for DesignLab. DesignLab libraries let you make “Chips” you can use in any of your DesignLab circuits. Make chips with VHDL, Verilog, or the Schematic editor, the choice is yours!

Library types

As of Designlab 1.05. there are three Library templates :
– which uses schematic
– which uses wishbone schemac
– which uses wishbone Vhdl
designlab1.0.5 library_types
This Guide will cover the first one – Stand Alone Schematic. Please take a look at these additional guides for the other types :

  • Wishbone Schematic
  • Wishbone VHDL

 

Schematic Library

 

To create a schematic library we click on it and then we have to choose a location where it will be saved
Save_Library_window
After that a new window pops up, which includes .cpp and .h tabs and the edit_library tab, which includes the steps one has to make for creating a library.
Edit_library_template
The first two steps have to be done no matter what library one makes. The next two are only applicable if one makes a wishbone library. The last one is optional but advisable.
The first step is to define your chip, which will be available to every circuit you make in the future (provided the library is installed). After the chip is defined you want to make examples how to use it for every board in the second step. If the chip uses the wishbone then in the third step one can create an interface to communicate with it. After that you should create an example sketch for your library in the fourth step.

 

Creating a chip

After we click on the link in step 1  the ISE will open up. The chip creation has two parts – the first one edit_your_chip_design and the second Simulate_your design.
The simulation is a way of verification that the chip is behaving like it is supposed to.
Double clicking on edit_your_chip_design will open the template example schematic.
Hold CTRL and use the mouse wheel to zoom in/out. You can click on the toggle transcript window button to maximize/minimize  the windows space.
toggle_button

By right clicking on the symbol and then:

  • Symbol -> Push into Symbol you can view the inner circuit of the chip.
  • Symbol -> Edit Symbol you can change the look of the symbol

The inner circuit looks like the picture below:

shematic_inner_templateSince we want to change it we will for example replace the input buffer with an inverter. To do that after we delete the buffer symbol we search/write in Symbol name Filter “inv” and then click on the result and then put the new symbol in place of the buffer.

add_inverter

Now since the buttons and leds are busies and the inverter is not we get the following  error :

error_bus_diff

Luckily this can be easy fixed – we right click on the Inverter symbol then go to Symbol->Rename Selected Instance

rename_instance

In the new window we select Iterated Instance Name and then write for starting and end value the same values as in the buttons :

ref_name

If you click on the Check Schematic button you can verify that every thing is right.
check_schematic

 

 

Simulation

Now after we save and close the schematic window, we want to simulate how the chip is behaving. In order to do that we click on Simulate and then select the Simulate_Your_CCL_Design and then double click on Simulate behavior Model.

simulate_a

After the new window opens we expand all pins and Your_ External_pins and then  hit F6 to zoom out and see the whole simulation. As expected when the buttons are ‘0’ the leds are ‘1’ and when they are ‘1’ the leds are ‘0’ .

sim_results

The yellow vertical line shows the values of signals  for a specific ns. For example in the above picture this is 239.834 ns. You can move it with a left mouse click in the simulation window.

 

Changing the design further

Let us now change the number of buttons and leds for example lets make them 8.  To do that we open the schematic again, push into it as before and now we right click on the buttons first and click  Rename Port . In the new window we select Rename the branch and then write buttons(7 :0) instead of the current  buttons(3 :0).

rename bus

We repeat this step for the leds signal and then as shown above also for the inverter.

Before you close the schematic you could check it for errors as shown above.

We made changes to the interface of our chip, but the schematic symbol of it doused automatically change as well.  To update it we make sure we are in Implementation view and then expand the Edit_Your_Chip_Design click on the Example_Library. After that we expand the Design_Utilities and double click on Create Schematic Symbol .

Schematic_update

Now we if you haven’t closed the schematic window you have to make a click in it in order for the ISE do detect that the symbol has changed and pop up a window to acknowledge the update .
update_symb

Changing the simulation model

Since we have a new chip interface, we have to modify the simulation model in order to be able to simulate it.  To do that we go back to the Simulation view  and double click on Simulate_Your_CCL_Design which opens the simulation model as vhdl code.

edit_sym_model

 

The simulation model specify stimulus for the chip design. This is a fancy way of saying that we take a time period for example 1000 ns and then specify how all chip input signals change in this period. Now by looking at the values of the output signals we can determine if the chip is behaving accordingly.

In the opened up vhdl file we have to modify all signals named buttons and leds to have 8 bits as the new interface. This is done by changing the (3 downto 0) section to (7 downto 0) . Some where in the code this pins get initialized or get new values assigned, this new values have also to be 8 bits long.

bit_change1bit_change2

Now we simulate as shown above and if the we are happy with the results we close the ISE.

Creating examples for all boards

If look back at our edit_library tab in the Library template we will see that till know we finished only step 1.  Now we move to step 2. In this tutorial we will create a circuit only for the Papilio Pro board cause the next steps are identical for all other boards.  To start we click on the Papilio Pro link.

Edit_library_template

After the ISE opens we double click on the Papilio_Pro to open the schematic window.

papilio_pro

Since we created a new symbol the ISE will want that we acknowledge to update the symbol, but we can have access to the symbol also if we click on Symbols tab and then find our library in Categories and click on it.

Library_symbol

Now that we have the symbol we want to connect some board peripherals to it. The easiest way to do that is to go to Design tab and double click on Utility which opens a new window with all board peripherals.  From this new window we can select and copy peripherals we want to use and then past it in the Library schematic window.

board_periferal

Let us take all the Wing_AL pins and paste them in our Library schematic.  Instead of making a so called bus tap there is a easier way – if we use the bus8 symbol. You can find it like the inverter symbol above in this tutorial.

After you select the bus8 symbol you can rotate it from the orientation menu under it.

You should end up with something like this :

bus8We will put I/O markers to the  input bus8 by clicking on the  I/O button and then drawing a squire around the signals.

I/O marker

Now we go back to the Utility tab and using the Add Net Name button we pick up a pin name – for example Wing_AH0

pick up name

Now we go back and using the same button, but we select the Increase the name option we click on the wire/ line of all Input pins.

put_name

After we are ready, we save, go back to Design tab  and double click on Generate Programing File . When the generation ends. We close the ISE and go back to our edit_library tab in the Library template. Now you should repeat this step for all other boards.

 Load circuit

If we want to test the generated circuit and have a Papilio Pro connected we go to Tools – Board – and select the Papilio Pro. Then we click on the Load circuit button.

Sharing the Library

To share this new library we go to Tools – Archive Sketch save the archive and then click on the link in step 4 to head up to Designlab-libraries

Full Video Walkthrough

 

Tags: libraries

Comments

comments

About Gadget Factory

We make Open Source Hardware that is extremely Hackable, what we call Hack|Ware. Founded in 2009 by Aspiring Inventor Jack Gassett, we are hardware suppliers and inventors with a community focused approach. Home of the Papilio FPGA board and other open source hardware designs.

Located in Denver, Colorado just minutes away from beautiful Boulder, Colorado.

Gadget Factory Learning Site

Inspired by the excellent learning sites at Adafruit and Sparkfun we made our own learning site with tutorials about FPGA's, Electronics, and Making Open Source Hardware. If you have tutorials you would like to contribute please contact us at support@gadgetfactory.net.

If you have a project or code that you would like to share please post to the Showcase website.
© Gadget Factory 2013