Skip to content

Commit

Permalink
Merge pull request #438 from antoinevg/antoinevg/add-cynthion-testbench
Browse files Browse the repository at this point in the history
Add testbench for GSG Cynthion
  • Loading branch information
Obijuan authored Oct 7, 2024
2 parents 030e677 + 36a0c2c commit 3158504
Show file tree
Hide file tree
Showing 12 changed files with 426 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[env]
board = Cynthion-r1.4
124 changes: 124 additions & 0 deletions test-examples/TB/GreatScottGadgets-Cynthion/icestudio/ledon/ledon.ice
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"version": "1.2",
"package": {
"name": "",
"version": "",
"description": "",
"author": "",
"image": ""
},
"design": {
"board": "Cynthion-r1.4",
"graph": {
"blocks": [
{
"id": "5f9c1a21-fb87-42ea-a324-958725c7f903",
"type": "basic.output",
"data": {
"name": "LED",
"virtual": false,
"pins": [
{
"index": "0",
"name": "led_0",
"value": "E13"
}
]
},
"position": {
"x": 584,
"y": 272
}
},
{
"id": "bdeadd18-fbf1-4eab-81bc-c1cf83b1dce1",
"type": "febcfed8636b8ee9a98750b96ed9e53a165dd4a8",
"position": {
"x": 376,
"y": 272
},
"size": {
"width": 96,
"height": 64
}
}
],
"wires": [
{
"source": {
"block": "bdeadd18-fbf1-4eab-81bc-c1cf83b1dce1",
"port": "3d584b0a-29eb-47af-8c43-c0822282ef05"
},
"target": {
"block": "5f9c1a21-fb87-42ea-a324-958725c7f903",
"port": "in"
}
}
]
}
},
"dependencies": {
"febcfed8636b8ee9a98750b96ed9e53a165dd4a8": {
"package": {
"name": "bit-1",
"version": "0.2",
"description": "Constant bit 1",
"author": "Jesus Arroyo",
"image": "%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%2289.79%22%20height=%22185.093%22%20viewBox=%220%200%2084.179064%20173.52585%22%3E%3Cpath%20d=%22M7.702%2032.42L49.972%200l34.207%207.725-27.333%20116.736-26.607-6.01L51.26%2025.273%2020.023%2044.2z%22%20fill=%22green%22%20fill-rule=%22evenodd%22/%3E%3Cpath%20d=%22M46.13%20117.28l21.355%2028.258-17.91%2021.368%206.198%205.513m-14.033-54.45l-12.4%2028.26-28.242%205.512%202.067%208.959%22%20fill=%22none%22%20stroke=%22green%22%20stroke-width=%222.196%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22/%3E%3C/svg%3E"
},
"design": {
"graph": {
"blocks": [
{
"id": "3d584b0a-29eb-47af-8c43-c0822282ef05",
"type": "basic.output",
"data": {
"name": ""
},
"position": {
"x": 456,
"y": 120
}
},
{
"id": "61331ec5-2c56-4cdd-b607-e63b1502fa65",
"type": "basic.code",
"data": {
"code": "//-- Constant bit-1\nassign q = 1'b1;\n\n",
"params": [],
"ports": {
"in": [],
"out": [
{
"name": "q"
}
]
}
},
"position": {
"x": 168,
"y": 112
},
"size": {
"width": 248,
"height": 80
}
}
],
"wires": [
{
"source": {
"block": "61331ec5-2c56-4cdd-b607-e63b1502fa65",
"port": "q"
},
"target": {
"block": "3d584b0a-29eb-47af-8c43-c0822282ef05",
"port": "in"
}
}
]
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[*] Code generated by Icestudio 0.12.1w202410070310202410070310
[*] Mon, 07 Oct 2024 14:01:25 GMT

main_tb.LED
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Code generated by Icestudio 0.12.1w202410070310202410070310
// Mon, 07 Oct 2024 14:01:21 GMT

// Testbench template

`default_nettype none
`define DUMPSTR(x) `"x.vcd`"
`timescale 10 ns / 1 ns


module main_tb
;

// Simulation time: 100ns (10 * 10ns)
parameter DURATION = 10;

// Input/Output
wire LED;

// Module instance
main MAIN (
.v8bfc7f(LED)
);

initial begin
// File were to store the simulation results
$dumpfile(`DUMPSTR(`VCD_OUTPUT));
$dumpvars(0, main_tb);

// TODO: initialize the registers here
// e.g. value = 1;
// e.g. #2 value = 0;

#(DURATION) $display("End of simulation");
$finish;
end

endmodule
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Code generated by Icestudio 0.12.1w202410070310202410070310
# Mon, 07 Oct 2024 14:01:15 GMT

set_io v8bfc7f E13
41 changes: 41 additions & 0 deletions test-examples/TB/GreatScottGadgets-Cynthion/icestudio/ledon/main.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Code generated by Icestudio 0.12.1w202410070310202410070310
// Mon, 07 Oct 2024 14:01:06 GMT

`default_nettype none

//---- Top entity
module main (
output v8bfc7f
);
wire w0;
assign v8bfc7f = w0;
vfebcfe vb9eb2f (
.v9fb85f(w0)
);
endmodule

//---- Top entity
module vfebcfe (
output v9fb85f
);
wire w0;
assign v9fb85f = w0;
vfebcfe_vb2eccd vb2eccd (
.q(w0)
);
endmodule

//---------------------------------------------------
//-- bit-1
//-- - - - - - - - - - - - - - - - - - - - - - - - --
//-- Constant bit 1
//---------------------------------------------------

module vfebcfe_vb2eccd (
output q
);
//-- Constant bit-1
assign q = 1'b1;


endmodule
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[env]
board = Cynthion-r1.4
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Code generated by Icestudio 0.12.1w202410070310202410070310
# Mon, 07 Oct 2024 14:01:40 GMT

set_io v8bfc7f E13
41 changes: 41 additions & 0 deletions test-examples/TB/GreatScottGadgets-Cynthion/icestudio/tff/main.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Code generated by Icestudio 0.12.1w202410070310202410070310
// Mon, 07 Oct 2024 14:01:34 GMT

`default_nettype none

//---- Top entity
module main (
output v8bfc7f
);
wire w0;
assign v8bfc7f = w0;
vfebcfe vb9eb2f (
.v9fb85f(w0)
);
endmodule

//---- Top entity
module vfebcfe (
output v9fb85f
);
wire w0;
assign v9fb85f = w0;
vfebcfe_vb2eccd vb2eccd (
.q(w0)
);
endmodule

//---------------------------------------------------
//-- bit-1
//-- - - - - - - - - - - - - - - - - - - - - - - - --
//-- Constant bit 1
//---------------------------------------------------

module vfebcfe_vb2eccd (
output q
);
//-- Constant bit-1
assign q = 1'b1;


endmodule
124 changes: 124 additions & 0 deletions test-examples/TB/GreatScottGadgets-Cynthion/icestudio/tff/tff.ice
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"version": "1.2",
"package": {
"name": "",
"version": "",
"description": "",
"author": "",
"image": ""
},
"design": {
"board": "alhambra-ii",
"graph": {
"blocks": [
{
"id": "5f9c1a21-fb87-42ea-a324-958725c7f903",
"type": "basic.output",
"data": {
"name": "LED",
"virtual": false,
"pins": [
{
"index": "0",
"name": "LED0",
"value": "45"
}
]
},
"position": {
"x": 968,
"y": 360
}
},
{
"id": "bdeadd18-fbf1-4eab-81bc-c1cf83b1dce1",
"type": "febcfed8636b8ee9a98750b96ed9e53a165dd4a8",
"position": {
"x": 760,
"y": 360
},
"size": {
"width": 96,
"height": 64
}
}
],
"wires": [
{
"source": {
"block": "bdeadd18-fbf1-4eab-81bc-c1cf83b1dce1",
"port": "3d584b0a-29eb-47af-8c43-c0822282ef05"
},
"target": {
"block": "5f9c1a21-fb87-42ea-a324-958725c7f903",
"port": "in"
}
}
]
}
},
"dependencies": {
"febcfed8636b8ee9a98750b96ed9e53a165dd4a8": {
"package": {
"name": "bit-1",
"version": "0.2",
"description": "Constant bit 1",
"author": "Jesus Arroyo",
"image": "%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%2289.79%22%20height=%22185.093%22%20viewBox=%220%200%2084.179064%20173.52585%22%3E%3Cpath%20d=%22M7.702%2032.42L49.972%200l34.207%207.725-27.333%20116.736-26.607-6.01L51.26%2025.273%2020.023%2044.2z%22%20fill=%22green%22%20fill-rule=%22evenodd%22/%3E%3Cpath%20d=%22M46.13%20117.28l21.355%2028.258-17.91%2021.368%206.198%205.513m-14.033-54.45l-12.4%2028.26-28.242%205.512%202.067%208.959%22%20fill=%22none%22%20stroke=%22green%22%20stroke-width=%222.196%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22/%3E%3C/svg%3E"
},
"design": {
"graph": {
"blocks": [
{
"id": "3d584b0a-29eb-47af-8c43-c0822282ef05",
"type": "basic.output",
"data": {
"name": ""
},
"position": {
"x": 456,
"y": 120
}
},
{
"id": "61331ec5-2c56-4cdd-b607-e63b1502fa65",
"type": "basic.code",
"data": {
"code": "//-- Constant bit-1\nassign q = 1'b1;\n\n",
"params": [],
"ports": {
"in": [],
"out": [
{
"name": "q"
}
]
}
},
"position": {
"x": 168,
"y": 112
},
"size": {
"width": 248,
"height": 80
}
}
],
"wires": [
{
"source": {
"block": "61331ec5-2c56-4cdd-b607-e63b1502fa65",
"port": "q"
},
"target": {
"block": "3d584b0a-29eb-47af-8c43-c0822282ef05",
"port": "in"
}
}
]
}
}
}
}
}
Loading

0 comments on commit 3158504

Please sign in to comment.