summaryrefslogtreecommitdiff
path: root/xtools/check_iirs.adb
diff options
context:
space:
mode:
authorgingold2005-09-24 05:10:24 +0000
committergingold2005-09-24 05:10:24 +0000
commit977ff5e02c6d2f9bfdabcf8b4e98b81e2d83e849 (patch)
tree7bcf8e7aff40a8b54d4af83e90cccd73568e77bb /xtools/check_iirs.adb
downloadghdl-977ff5e02c6d2f9bfdabcf8b4e98b81e2d83e849.tar.gz
ghdl-977ff5e02c6d2f9bfdabcf8b4e98b81e2d83e849.tar.bz2
ghdl-977ff5e02c6d2f9bfdabcf8b4e98b81e2d83e849.zip
First import from sources
Diffstat (limited to 'xtools/check_iirs.adb')
-rw-r--r--xtools/check_iirs.adb64
1 files changed, 64 insertions, 0 deletions
diff --git a/xtools/check_iirs.adb b/xtools/check_iirs.adb
new file mode 100644
index 0000000..3b28dfe
--- /dev/null
+++ b/xtools/check_iirs.adb
@@ -0,0 +1,64 @@
+-- Tool to check the coherence of the iirs package.
+-- Copyright (C) 2002, 2003, 2004, 2005 Tristan Gingold
+--
+-- GHDL is free software; you can redistribute it and/or modify it under
+-- the terms of the GNU General Public License as published by the Free
+-- Software Foundation; either version 2, or (at your option) any later
+-- version.
+--
+-- GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
+-- WARRANTY; without even the implied warranty of MERCHANTABILITY or
+-- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+-- for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with GCC; see the file COPYING. If not, write to the Free
+-- Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+-- 02111-1307, USA.
+with Check_Iirs_Pkg;
+with Ada.Command_Line; use Ada.Command_Line;
+with Ada.Text_IO; use Ada.Text_IO;
+
+procedure Check_Iirs
+is
+ type Prg_Mode is (Mode_Generate, Mode_Genfast, Mode_Free);
+ Mode : Prg_Mode;
+ procedure Usage is
+ begin
+ Put_Line ("usage: " & Command_Name & " MODE");
+ Put_Line ("MODE is one of:");
+ Put_Line (" --generate");
+ Put_Line (" --genfast");
+ Put_Line (" --list-free-fields");
+ end Usage;
+begin
+ if Argument_Count /= 1 then
+ Usage;
+ Set_Exit_Status (Failure);
+ return;
+ end if;
+ if Argument (1) = "--generate" then
+ Mode := Mode_Generate;
+ elsif Argument (1) = "--genfast" then
+ Mode := Mode_Genfast;
+ elsif Argument (1) = "--list-free-fields" then
+ Mode := Mode_Free;
+ else
+ Usage;
+ Set_Exit_Status (Failure);
+ return;
+ end if;
+
+ Check_Iirs_Pkg.Read_Fields;
+ Check_Iirs_Pkg.Check_Iirs;
+ Check_Iirs_Pkg.Read_Desc;
+ case Mode is
+ when Mode_Generate =>
+ Check_Iirs_Pkg.Gen_Func;
+ when Mode_Genfast =>
+ Check_Iirs_Pkg.Flag_Checks := False;
+ Check_Iirs_Pkg.Gen_Func;
+ when Mode_Free =>
+ Check_Iirs_Pkg.List_Free_Fields;
+ end case;
+end Check_Iirs;