Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions tclapp/aldec/alint/alint.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package require Tcl 8.5

namespace eval ::tclapp::aldec::alint {
# Allow Tcl to find tclIndex
variable home [file join [pwd] [file dirname [info script]]]
if {[lsearch -exact $::auto_path $home] == -1} {
lappend ::auto_path $home
}
}

package provide ::tclapp::aldec::alint 1.0
1 change: 1 addition & 0 deletions tclapp/aldec/alint/alint_script.do
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
convert.xpr.project {*}$argv
19 changes: 19 additions & 0 deletions tclapp/aldec/alint/app.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<catalog>
<apps>
<app>
<revision_history>Initial version</revision_history>
<name>alint</name>
<company>aldec</company>
<company_display>Aldec, Inc.</company_display>
<summary>This is an Aldec ALINT-PRO Linter integration app that allows users to convert a Vivado project to an ALINT-PRO project. ALINT-PRO is a design verification solution for RTL code written in VHDL, Verilog, and SystemVerilog, which is focused on verifying coding style and naming conventions, RTL and post-synthesis simulation mismatches, smooth and optimal synthesis, correct FSM descriptions, avoiding problems on further design stages, clocks and reset tree issues, CDC, RDC, DFT, and coding for portability and reuse. You can generate an ALINT-PRO project and also start ALINT-PRO in GUI mode with the converted project directly from Vivado IDE. The ALINT-PRO project files are saved in the same location as the currently opened Vivado project. To run ALINT-PRO conversion, please ensure that the ALINT-PRO software and required licenses are available. For more details, please check the help message for the Tcl Procs below.</summary>
<display>ALINT-PRO Linter</display>
<procs>
<proc>
<name>convert_project</name>
<summary>Convert Vivado project to ALINT-PRO</summary>
</proc>
</procs>
</app>
</apps>
</catalog>
95 changes: 95 additions & 0 deletions tclapp/aldec/alint/convert_project.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
package require Vivado 1.2024.1

namespace eval ::tclapp::aldec::alint {
namespace export convert_project
}

proc ::tclapp::aldec::alint::convert_project {args} {

# Summary: Convert Vivado project to ALINT-PRO

# Argument Usage:
# alint_path: Path where ALINT-PRO is located
# [-gui]: Start ALINT-PRO in GUI mode and don't exit after converting
# [-usage]: This help message

# Return Value:

# Categories: xilinxtclstore, aldec, alint, convert

set usage [format {
Usage: aldec::alint::convert_project
alint_path - Path where ALINT-PRO is located
[-gui] - Start ALINT-PRO in GUI mode and don't exit after converting
[-usage] - This help message

Description: Convert Vivado project to ALINT-PRO
Example:
aldec::alint::convert_project ~/ALINT-PRO
aldec::alint::convert_project -gui ~/ALINT-PRO
}]

set gui false
set help false

foreach arg $args {
switch -- $arg {
-gui {
set gui true
}
-usage {
set help true
}
-* {
error "Unrecognized option $arg"
}
default {
if {[info exists alint_path]} {
error "Too many arguments\n$usage"
}
set alint_path $arg
}
}
}

if {$help} {
puts $usage
return
}

if {![info exists alint_path]} {
error "ALINT-PRO path not passed\n$usage"
}

if {$gui} {
set alint_bin $alint_path/bin/alint
} else {
set alint_bin $alint_path/bin/alintcon
}
if {$::tcl_platform(platform) == "windows"} {
set alint_bin $alint_bin.exe
}

if {![file exists $alint_bin]} {
error "Required file $alint_bin not found"
}

set this_script_path [dict get [info frame 0] file]
set alint_script_path [file dirname $this_script_path]/alint_script.do

set project_dir [get_property DIRECTORY [current_project]]
set project_name [get_property NAME [current_project]]
set xpr_path [file join $project_dir $project_name.xpr]
if {![file exists $xpr_path]} {
error "Project file not found"
}

if {$gui} {
exec -- $alint_bin \
-do $alint_script_path $xpr_path &
} else {
exec -- $alint_bin \
-batch \
-do $alint_script_path $xpr_path
}
}
18 changes: 18 additions & 0 deletions tclapp/aldec/alint/doc/convert_project
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

Description:
Convert a Vivado project to an ALINT-PRO format directly from Vivado IDE.

The ALINT-PRO project files are saved in the same location as the currently
opened Vivado project. To run ALINT-PRO conversion, please ensure that the
ALINT-PRO software and required licenses are available.

Optionally, ALINT-PRO can be started in GUI mode with the converted project
using the -gui flag.

Examples:

Convert the project by running ALINT-PRO in the batch mode and exiting:
::aldec::alint::convert_project <alint_path>

Convert the project by running ALINT-PRO in the GUI mode:
::aldec::alint::convert_project -gui <alint_path>
18 changes: 18 additions & 0 deletions tclapp/aldec/alint/doc/legal.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Copyright (c) 2025, Aldec, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


=================================================================================================
This file must be included in <app>/doc/legal.txt for all accepted contributions to the Xilinx Tcl Store.
All contributors must date and digitally sign once below in order to submit to the Xilinx Tcl Store
<YYYYMMDD Date>::<github id>::<Full Name>
=================================================================================================
20250627::cezdro::Cezary Drożak
11 changes: 11 additions & 0 deletions tclapp/aldec/alint/pkgIndex.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Tcl package index file, version 1.1
# This file is generated by the "pkg_mkIndex" command
# and sourced either when an application starts up or
# by a "package unknown" script. It invokes the
# "package ifneeded" command to set up package-related
# information so that packages will be loaded automatically
# in response to "package require" commands. When this
# script is sourced, the variable $dir must contain the
# full path name of this file's directory.

package ifneeded ::tclapp::aldec::alint 1.0 [list source [file join $dir alint.tcl]]
1 change: 1 addition & 0 deletions tclapp/aldec/alint/revision_history.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0 Initial version
9 changes: 9 additions & 0 deletions tclapp/aldec/alint/tclIndex
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Tcl autoload index file, version 2.0
# This file is generated by the "auto_mkindex" command
# and sourced to set up indexing information for one or
# more commands. Typically each line is a command that
# sets an element in the auto_index array, where the
# element name is the name of a command and the value is
# a script that loads the command.

set auto_index(::tclapp::aldec::alint::convert_project) [list source [file join $dir convert_project.tcl]]
4 changes: 4 additions & 0 deletions tclapp/aldec/alint/tclstore.wpc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version:1
74636c73746f7265:6170705f696e7374616c6c5f636f756e743a3a616c696e74:3235:74636c73746f72655c7573616765:00:00:
74636c73746f7265:6c696e745f66696c65735f636f756e74:33:74636c73746f72655c7573616765:00:00:
eof:2000902078
38 changes: 38 additions & 0 deletions tclapp/aldec/alint/test/src/testbench.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
`timescale 1ns / 1ps
module testbench;

reg CLK = 0;
reg RST = 0;
reg [3:0] D;
wire [3:0] O;

UUT uut (
.CLK(CLK),
.RST(RST),
.D(D),
.O(O)
);

initial
forever CLK = #10 ~CLK;

initial
begin
RST = 1;
D = 0;
#100;
RST = 0;
#100;
D = 3;
#100;
D = 4;
#100;
D = 7;
#100;
D = 0;
$display("SIMULATION_FINISHED");
end



endmodule
16 changes: 16 additions & 0 deletions tclapp/aldec/alint/test/src/uut.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
`timescale 1ns / 1ps
module UUT(CLK,RST,D,O);

input CLK;
input RST;
input [3:0] D;
output [3:0] O;
reg [3:0] O;

always @(posedge CLK)
if (RST)
O <= 'b0;
else
O <= D;

endmodule
49 changes: 49 additions & 0 deletions tclapp/aldec/alint/test/test.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
set app_name {aldec::alint}

if {![info exists alint_path]} {
error "alint tests require \$alint_path variable to run"
}

set file_dir [file normalize [file dirname [info script]]]
puts "== Unit Test directory: $file_dir"

set ::env(XILINX_TCLAPP_REPO) [file normalize [file join $file_dir .. .. ..]]
puts "== Application directory: $::env(XILINX_TCLAPP_REPO)"
lappend auto_path $::env(XILINX_TCLAPP_REPO)

set list_installed_apps [::tclapp::list_apps]

# Uninstall the app if it is already installed
if {[lsearch -exact $list_installed_apps $app_name] != -1} {
::tclapp::unload_app $app_name
}

# Install the app and require the package
catch "package forget ::tclapp::${app_name}"
::tclapp::load_app $app_name
package require ::tclapp::${app_name}

set project_name "test_project"

# Prepare Vivado project
create_project -force -quiet $project_name ./$project_name
add_files -copy_to ./$project_name/sources -force -fileset sources_1 "$file_dir/src/uut.v"
add_files -copy_to ./$project_name/sources -force -fileset sim_1 "$file_dir/src/testbench.v"
update_compile_order -fileset sources_1
update_compile_order -fileset sim_1

::tclapp::${app_name}::convert_project $alint_path

if {[file exists ./$project_name/ALINT-PRO/$project_name.alintws]} {
puts "TEST_PASSED"
} else {
error "TEST_FAILED"
}

close_project
file delete -force ./$project_name

# Uninstall the app if it was not already installed when starting the script
if {[lsearch -exact $list_installed_apps $app_name] == -1} {
::tclapp::unload_app $app_name
}