Adding custom Verilog modules

Discussions related to embedded firmware, driver, and user mode application software development

Moderator: robert.ghilduta

Post Reply
Dmitry_K
Posts: 7
Joined: Mon Oct 23, 2017 9:03 am

Adding custom Verilog modules

Post by Dmitry_K » Tue Jan 23, 2018 9:51 am

Hello, Colleagues

In the document "Adding custom VHDL modules or Altera IP" (https://github.com/Nuand/bladeRF/wiki/F ... -altera-ip) the procedure of adding VHDL-modules, which are developed by customer, is described . Could I add custom Verilog -modules, not the .vhd-modules? Will the addition procedure change?

Thanks, Dmitry_K

bglod
Posts: 128
Joined: Thu Jun 18, 2015 6:10 pm

Re: Adding custom Verilog modules

Post by bglod » Tue Jan 23, 2018 10:20 am

Absolutely! The procedure is similar, just change the -name parameter of the set_global_assignment command from "-name VHDL_FILE" to "-name VERILOG_FILE". Remember that as a limitation of Quartus (and Xilinx Vivado), direct instantiation of a verilog module inside a VHDL design is not supported. Instead, you'll have to do the "old-fashioned" VHDL component declaration prior to instantiating the component, unfortunately.
Electrical Engineer
Nuand, LLC.

Dmitry_K
Posts: 7
Joined: Mon Oct 23, 2017 9:03 am

Re: Adding custom Verilog modules

Post by Dmitry_K » Tue Jan 23, 2018 10:59 am

bglod wrote:
Tue Jan 23, 2018 10:20 am
Absolutely! The procedure is similar, just change the -name parameter of the set_global_assignment command from "-name VHDL_FILE" to "-name VERILOG_FILE". Remember that as a limitation of Quartus (and Xilinx Vivado), direct instantiation of a verilog module inside a VHDL design is not supported. Instead, you'll have to do the "old-fashioned" VHDL component declaration prior to instantiating the component, unfortunately.
Thank You, bglod.

Dmitry_K
Posts: 7
Joined: Mon Oct 23, 2017 9:03 am

Re: Adding custom Verilog modules

Post by Dmitry_K » Wed Jan 24, 2018 12:19 pm

In order to understanding the algorithm of custom Verilog modules adding, I develop Verilog-module, which is used for the same function as an example, described in "Tutorial: Blinking some LEDs". To instantiate my Verilog-module in bladerf-hosted.vhd I followed the steps below:

Step_1. I have run the build script to build the FPGA bitstream for non-modernized project and got success.
Step_2. I wrote a Verilog file for my custom module. I repeat: that module performs the same function as an example, described in "Tutorial: Blinking some LEDs":

Image
Img 1. New_module_for_BladeRF_experiment.


Step_3. I instantiated the module in bladerf-hosted.vhd:

--********************My verilog-modul************************************
U_New_module_for_BladeRF_experiment : entity work.New_module_for_BladeRF_experiment
generic map (
RESET_LEVEL => '0'
) port map (
CLK => c4_clock,
LED_out[0] => led(1),
LED_out[1] => led(2),
LED_out[2] => led(3)
) ;

--************************************************************************

Image
Img 2. New_module installation in bladerf-hosted.vhd

Step_4. I opened bladerf-hosted.qip and add the relative path to my module:

set_global_assignment -name VERILOG_FILE [file normalize [file join $here D:/Altera_programming/CSI_2/New_module_for_BladeRF_experiment/24jan_2018/New_module_for_BladeRF_experiment.v]]

Image
Img.3. New_module_adding_in_bladerf_hosted_qip

Step_5. I have run the build script to build the FPGA bitstream for modernized project and got unsuccess:
Image
Img 4. New_module_Project_building_ERROR


WHAT IS THE MISTAKE?

bglod
Posts: 128
Joined: Thu Jun 18, 2015 6:10 pm

Re: Adding custom Verilog modules

Post by bglod » Wed Jan 24, 2018 4:37 pm

Take a look at lines 585, 586, and 587 in your bladerf-hosted.vhd file as the error is suggesting. The syntax "[0]" is incorrect with the square brackets. In VHDL, to slice an array type, parentheses are used: "(0)". Alternatively, you may simplify your LED_out port map to just "LED_out => led" if you want. The bit indices will remap 2:0 to 3:1 automatically. What you did is fine too as it's more explicit for the reader and shows that the index remapping is intentional.

Later, you will get another error stating that your module was not found in library work. This is because you cannot directly instantiate Verilog modules (limitation of Quartus, and last I checked Vivado had the same limitation). Instead, you'll have to declare the component first, then instantiate the component.

You will get yet another error about the RESET_LEVEL parameter in your generic map. This parameter doesn't exist in your Verilog design. I assume it's in your generic map because you copy/pasted the previous entity instantiation. Either declare it in your Verilog, or delete the generic map section altogether. The latter seems more appropriate in this example.
Electrical Engineer
Nuand, LLC.

Dmitry_K
Posts: 7
Joined: Mon Oct 23, 2017 9:03 am

Re: Adding custom Verilog modules

Post by Dmitry_K » Thu Jan 25, 2018 5:52 am

Dear, bglod

Today I made some correection according to Your replay.
Step_1 I was change the Verilog-source of my module in order to simplify my LED_out port map:

Image

Step_2 I changed the declaration way of my module instance in bladerf-hosted.vhd - in according to Your advice, I deleted the generic map section altogether:

--********************My verilog-modul********************************************************************************************
U_New_module_for_BladeRF_experiment : entity work.New_module_for_BladeRF_experiment
port map (
CLK => c4_clock,
LED_out_1 => led(1),
LED_out_2 => led(2),
LED_out_3 => led(3)
) ;
--*********************************************************************************************************************************


Image

Step_3 I place Verilog-source file of my module in the active project folder \bladeRF-1\hdl\fpga\ip\nuand\new_module\New_module_for_BladeRF_experiment.v and changed bladerf-hosted.qip file (I changed relative path to my module):
Image

Step_5 I have run the build script to build the FPGA bitstream for modernized project and got unsuccess again. But errors quantity was less (only 1 error):

Image

How to fix this error?
Thanks.

bglod
Posts: 128
Joined: Thu Jun 18, 2015 6:10 pm

Re: Adding custom Verilog modules

Post by bglod » Thu Jan 25, 2018 7:11 am

You didn't have to make a separate output port for each LED. You could have kept it as a single bus of width 3 and just have the single port map. It would look something like this:

Code: Select all

port map (
    module_bus => toplevel_bus -- the left side is a 2:0 bus, the right is 3:1
);
Or, you could have done the following for explicit indexing:

Code: Select all

port map (
    module_bus(2) => toplevel_bus(3),
    module_bus(1) => toplevel_bus(2),
    module_bus(0) => toplevel_bus(1)
);
For the error you have now, please read my previous response. You cannot directly instantiate a verilog module in VHDL. You need to declare the component first. Take a look here:

https://www.doulos.com/knowhow/vhdl_des ... port_maps/
https://www.altera.com/support/support- ... 1_444.html
Electrical Engineer
Nuand, LLC.

yunch642
Posts: 7
Joined: Fri Aug 03, 2018 2:03 am

Re: Adding custom Verilog modules

Post by yunch642 » Sun Aug 19, 2018 11:27 pm

20180820 Pudding b
pandora jewelry
yeezy boost 350
red bottom shoes
timberland outlet
nike sneakers
air max 2018
skechers sneakers
pandora charms
air jordan shoes
pandora bracelets
jordan retro 12
nike store
polo outlet
fenty puma
kyrie 4 shoes
fake rolex watches
jordan retro 12
soldier 11
stephen curry shoes
birkenstock sandals
jordans shoes
pandora ring
longchamp bags
off white nike
pandora ring
converse outlet
coach factory outlet
adidas outlet online
pandora charms
pandora jewelry
timberland boots
longchamp handbags
nike outlet store
pandora charms
jordan 11 win like 96
pandora bracelets
kevin durant shoes
puma outlet
new jordans coming out
christian louboutin shoes
kobe bryant shoes
yeezy beluga 2.0
hermes handbags
vapor max
nike clearance store
nike vapor max
birkenstock outlet
adidas yeezy
nike cortez
longchamp bags
adidas yeezy
soccer shoes
pandora jewelry outlet
yeezy beluga 2.0
ray ban sunglasses
vans shoes
kobe 12
christian louboutin shoes
supremenewyork
north face
vapor max
north face jackets for women
longchamp handbags
swarovski crystal
under armour outlet online
under armour outlet online
pandora rings
nike vapor max
ecco shoes for men
skechers outlet
valentino shoes
vans for sale
reebok outlet
birkenstock sandals
calvin klein online
coach outlet store online
red jordan 11
soccer shoes
nike vapor max
air force 1
nike factory store
adidas nmd r1
soccer shoes
yeezy sneakers
skechers outlet
clarks shoes for women
air jordan
red 11s
north face jackets
under armour outlet
adidas ultra boost
yeezy zebra v2
canada goose coats
coach handbags
salvatore ferragamo
stephen curry shoes
pandora jewelry
north face outlet
kd 10 shoes
timberland boots for men
timberland shoes
north face outlet
polo ralph lauren outlet
ray ban sunglasses
pandora jewelry
north face clearance
vapor max
pandora rings
pandora jewelry
asics running shoes
adidas yeezy
lacoste outlet
fitflops sale
adidas outlet online
pandora jewelry
nike outlet store
coach handbags
adidas outlet
skechers outlet
coach factory outlet
jordan retro 11
longchamp handbags
ultra boost adidas
pandora charms sale
yeezy zebra v2
nike kyrie 3
timberland shoes
michael kors handbags
nike outlet store
yeezy boost 350
skechers outlet
supreme hoodie
kyrie 4 confetti
yeezy blue tint
kyrie 4 confetti
balenciaga sneakers
michael kors handbags
puma outlet
michael kors outlet online
curry shoes
nike air max plus
asics gel nimbus
nike air max 270
pandora charms
lacoste polo shirts
red bottom shoes
fitflops sale
balenciaga shoes
hilfiger outlet
off white nike
yeezy boost
asics running shoes
adidas yeezy
soldier 11
cheap nfl jerseys
nike outlet store
salvatore ferragamo
coach handbags
golden goose sneakers
red jordan 11
michael kors outlet
coach handbags
adidas nmd r1
nike outlet store
polo ralph lauren outlet
yeezy boost
celine handbags
pandora charms sale clearance
coach outlet online
coach outlet
nike air max 97
nike air max plus
pandora charms
kyrie shoes
nike factory store
pandora bracelets clearance
red bottom shoes
ugg slippers
best sunglasses
rolex replica
red bottom shoes
jordan 11 win like 82
jimmy choo shoes
lebron 15 shoes
adidas outlet
north face outlet
christian louboutin
coach handbags
red bottoms
balenciaga shoes
beats wireless
north face jackets
uggs for women
pandora charms
clarks shoes for women
air max 2018
goyard handbags
ray-ban sunglasses
yeezys for sale
wholesale jerseys china
rayban
uggs clearance
nike air huarache
adidas yeezy
north face outlet
the north face jackets
christian louboutin outlet
red bottom shoes
valentino outlet
north face outlet online
red bottom shoes
jordan 11 win like 96
swarovski crystal
birkenstock outlet
birkenstock sandals
celine handbags
timberland shoes
nike outlet store
polo shirts
pandora charms sale clearance
nike cortez men
red bottom shoes
pandora jewelry
nike air max plus
fitflops sale clearance
jordan retro 11
nike vapor max
jordan 11 win like 82
best replica watches
pandora charms
puma outlet
coach outlet store
air vapormax
curry 4 shoes
skechers outlet
north face outlet
off white jordan
longchamp handbags
nike vapor max plus
yeezy blue tint
ugg boots
north face clearance
pandora charms
kevin durant shoes
jimmy choo shoes
adidas yeezy
cheap nfl jerseys china
nike air max 270
barbour jackets
nike kyrie 3
golden goose sneakers
oakley sunglasses
calvin klein online
kate spade handbags
nike air max 95
nike outlet store
lebron 15 shoes
beats wireless
adidas yeezy
nike air max 270
pandora ring
north face outlet online
christian louboutin shoes
yeezy boost 350
adidas yeezy
the north face jackets
reebok shoes
louboutin boots
pandora jewelry
tommy hilfiger outlet
cheap nike shox
yeezys for sale
oakley eyeglasses
longchamp bags
calvin klein online
under armour outlet online
north face outlet
red bottom shoes
ugg australia
nike kd
soccer shoes
ecco shoes
balenciaga shoes
salvatore ferragamo
nike outlet store
yeezy boost
kyrie 3 shoes
adidas shoes for women
air force 1
adidas yeezy
fenty puma
clark shoes
mbt shoes
tory burch handbags
pandora charms
kate spade handbags
swarovski crystal
air max 97 ultra
balenciaga shoes
yeezys for sale
birkenstock sandals
uggs
fitflops
pandora rings
cheap nfl jerseys wholesale
kyrie 3
asics gel nimbus
huaraches nike
polo outlet
yeezy boost
tory burch outlet
polo shirts
polo ralph lauren

off white nike
nike outlet store
ralph lauren factory store
new jordan
nike air huarache
oakley sunglasses
air presto
uggs on sale
hermes handbags
louboutin shoes
north face outlet
louboutin shoes
skechers outlet
pandora charms sale clearance
adidas yeezy
skechers shoes
nike outlet store
pandora charms sale
kyrie 4 confetti
air max 2018
underarmour
nike air max 95
barbour jacket
yeezy boost
birkenstock sandals
pandora bracelets clearance
supreme hoodie
timberland shoes
north face outlet
under armour outlet online
vapor max
adidas yeezy
louboutin shoes
christian louboutin
pandora bracelets clearance
nike air max 97
red bottom shoes
nike shox for men
red bottom shoes
kyrie 4 confetti
fenty puma
north face outlet online
polo outlet
converse outlet
red jordan 11
goyard handbags
nike vapor max plus
adidas shoes for women
pandora jewelry
christian louboutin
kd 10
nike shoes
yeezy boost
ralph lauren outlet
soccer shoes
curry 4 shoes
yeezy boost
oakley sunglasses for men
pandora charms
new jordan
fitflops
louboutin outlet
adidas yeezy
nike uptempo
huaraches nike
ray ban eyeglasses
red jordan 11
nike vapor max
nike uptempo
kd 10 shoes
pandora jewelry official site
air presto
ugg slippers
birkenstock outlet
mbt shoes clearance
20180820 Pudding b

Post Reply