UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for
Search instead for
Did you mean:
Highlighted
Adventurer
566 Views
Registered: ‎01-09-2018

## Instantiation in Verilog (Test bench file) for a block design - Vivado

Jump to solution

Where is the instantiation list of the block?

It is not working with the list I found in design_1.bd under "components"

1 Solution

Accepted Solutions
Adventurer
470 Views
Registered: ‎01-09-2018

## Re: Instantiation of a block from the block design - Vivado

Jump to solution

I suppose it is not possible to instantiate the blocks?

so here the alternative I found doing it in html/ javascript,

here some code I use hope it helps (I included something to convert decimals and binaries or to do some padding:

just copy whats from <html> to </html> into a notepad and save as test.html or any other name and open it in a browser

<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>
<script>
var etad = new Date();
var i;

var text = "`timescale 1ns / 1ps<br>";
text += "// " + etad + " <br>";
text += "//  Comments <br>";

for (i = 0; i < 20; i += 1) {
text += "wire [7:0] D"+i+";"+ " <br>";
text += "assign D"+i+"[7:0] = ledx["+(7+i*8)+":"+(i*8)+"];"+ " <br>";
text += "assign swx["+(7+i*8)+":"+(i*8)+"] = DB[7:0];"+ " <br>"; }

text += "module test( swx, ledx); <br><br>";
text += "input [7:0] swx; <br>";
text += "output [7:0] ledx;<br>";
text += "endmodule ";

document.getElementById("demo").innerHTML = text;

function dec2bin(dec) {
return dec.toString(2);
}

function padDigits(number, digits) {
return Array(Math.max(digits - String(dec2bin(number)).length + 1, 0)).join(0) + dec2bin(number);
}

/*function exportToCsv() {
var myCsv = "Col1,Col2,Col3\nval1,val2,val3";

window.open('data&colon;text/csv;charset=utf-8,' + escape(myCsv));
}

var button = document.getElementById('b');
button.addEventListener('click', exportToCsv);

*/

</script>
</body>

</html>

4 Replies
Adventurer
553 Views
Registered: ‎01-09-2018

## Re: Instantiation of a block from the block design - Vivado

Jump to solution

1. I right clicked the block and chosed create hierarchy to push it one deeper

2. I ctrl click the design blocks that have Input/Outputs

3. I select the "Make External" so it wired the pins to the top layer

4. I wait 10-30 min for Vivado to write the files

5. open \project_1\project_1.srcs\sources_1\bd\design_1\design_1.bd

That file gives the instantiation list "component ..."

I am now trying to instanciate the block for a verilog file I am writing as test bench

where is the the instatiation for the block from the block design, I want to write a verilog test bench

Adventurer
479 Views
Registered: ‎01-09-2018

## Re: Instantiation of a block from the block design - Vivado

Jump to solution

Can I converty a block into verilog (like was possible for ISE)?

Adventurer
471 Views
Registered: ‎01-09-2018

## Re: Instantiation of a block from the block design - Vivado

Jump to solution

I suppose it is not possible to instantiate the blocks?

so here the alternative I found doing it in html/ javascript,

here some code I use hope it helps (I included something to convert decimals and binaries or to do some padding:

just copy whats from <html> to </html> into a notepad and save as test.html or any other name and open it in a browser

<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>
<script>
var etad = new Date();
var i;

var text = "`timescale 1ns / 1ps<br>";
text += "// " + etad + " <br>";
text += "//  Comments <br>";

for (i = 0; i < 20; i += 1) {
text += "wire [7:0] D"+i+";"+ " <br>";
text += "assign D"+i+"[7:0] = ledx["+(7+i*8)+":"+(i*8)+"];"+ " <br>";
text += "assign swx["+(7+i*8)+":"+(i*8)+"] = DB[7:0];"+ " <br>"; }

text += "module test( swx, ledx); <br><br>";
text += "input [7:0] swx; <br>";
text += "output [7:0] ledx;<br>";
text += "endmodule ";

document.getElementById("demo").innerHTML = text;

function dec2bin(dec) {
return dec.toString(2);
}

function padDigits(number, digits) {
return Array(Math.max(digits - String(dec2bin(number)).length + 1, 0)).join(0) + dec2bin(number);
}

/*function exportToCsv() {
var myCsv = "Col1,Col2,Col3\nval1,val2,val3";

window.open('data&colon;text/csv;charset=utf-8,' + escape(myCsv));
}

var button = document.getElementById('b');
button.addEventListener('click', exportToCsv);

*/

</script>
</body>

</html>

Adventurer
372 Views
Registered: ‎01-09-2018

## Re: Instantiation of a block from the block design - Vivado

Jump to solution

Note :

Edge IE and Chrome fail to let a copy paste for very large files but Mozilla Firefox managed fine.

That is what I found out after 3 hours trying to wait for Edge to crash and chrome none better.

Firefox worked and I was glad it installed also within seconds, sorry to mention this but Edge and Chrome fail so if anyone is using javascript for the very large netlists like I mentionned please use Firefox

please anyone give me Kudos I really spend lots of time to find all that out and share and deserve a bit of "kuddos-love"..