aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2020-02-17 18:47:26 +0000
committerYann Herklotz <git@yannherklotz.com>2020-02-17 18:47:26 +0000
commit75af84521208aac70375d7df45105256475d75b6 (patch)
treefc87f63175ba97789d837b3d286c019212780851 /src
parentabf33a4075c2008bfcac3b04ad3b4dc1c57a4efd (diff)
downloadvericert-kvx-75af84521208aac70375d7df45105256475d75b6.tar.gz
vericert-kvx-75af84521208aac70375d7df45105256475d75b6.zip
Update license to be compatible with CompCert
Diffstat (limited to 'src')
-rw-r--r--src/Common/Helper.v18
-rw-r--r--src/Common/Show.v18
-rw-r--r--src/Common/Tactics.v39
-rw-r--r--src/Driver/CompCert.v18
-rw-r--r--src/Driver/Driver.ml18
-rw-r--r--src/Extraction/Extraction.v18
-rw-r--r--src/Verilog/PrettyPrint.ml24
-rw-r--r--src/Verilog/PrettyPrint.mli18
-rw-r--r--src/Verilog/VerilogAST.v18
9 files changed, 173 insertions, 16 deletions
diff --git a/src/Common/Helper.v b/src/Common/Helper.v
index 292d011..d23dbe4 100644
--- a/src/Common/Helper.v
+++ b/src/Common/Helper.v
@@ -1,3 +1,21 @@
+(*
+ * CoqUp: Verified high-level synthesis.
+ * Copyright (C) 2019-2020 Yann Herklotz <yann@yannherklotz.com>
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ *)
+
Module Option.
Definition default {T : Type} (x : T) (u : option T) : T :=
diff --git a/src/Common/Show.v b/src/Common/Show.v
index 83ec5bc..8f9ec36 100644
--- a/src/Common/Show.v
+++ b/src/Common/Show.v
@@ -1,3 +1,21 @@
+(*
+ * CoqUp: Verified high-level synthesis.
+ * Copyright (C) 2019-2020 Yann Herklotz <yann@yannherklotz.com>
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ *)
+
From Coq Require Import
Strings.String
Bool.Bool
diff --git a/src/Common/Tactics.v b/src/Common/Tactics.v
index 5978d49..967c642 100644
--- a/src/Common/Tactics.v
+++ b/src/Common/Tactics.v
@@ -1,16 +1,29 @@
-Module Tactics.
+(*
+ * CoqUp: Verified high-level synthesis.
+ * Copyright (C) 2019-2020 Yann Herklotz <yann@yannherklotz.com>
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ *)
- Ltac unfold_rec c := unfold c; fold c.
+Ltac unfold_rec c := unfold c; fold c.
- Ltac solve_by_inverts n :=
- match goal with | H : ?T |- _ =>
- match type of T with Prop =>
- inversion H;
- match n with S (S (?n')) => subst; try constructor; solve_by_inverts (S n') end
- end
- end.
+Ltac solve_by_inverts n :=
+ match goal with | H : ?T |- _ =>
+ match type of T with Prop =>
+ inversion H;
+ match n with S (S (?n')) => subst; try constructor; solve_by_inverts (S n') end
+ end
+ end.
- Ltac solve_by_invert := solve_by_inverts 1.
-
-End Tactics.
-Export Tactics.
+Ltac solve_by_invert := solve_by_inverts 1.
diff --git a/src/Driver/CompCert.v b/src/Driver/CompCert.v
index c984690..d8dcb97 100644
--- a/src/Driver/CompCert.v
+++ b/src/Driver/CompCert.v
@@ -1,3 +1,21 @@
+(*
+ * CoqUp: Verified high-level synthesis.
+ * Copyright (C) 2019-2020 Yann Herklotz <yann@yannherklotz.com>
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ *)
+
From compcert.common Require Import
Errors
Linking.
diff --git a/src/Driver/Driver.ml b/src/Driver/Driver.ml
index 47125fa..40a45e6 100644
--- a/src/Driver/Driver.ml
+++ b/src/Driver/Driver.ml
@@ -1,3 +1,21 @@
+(*
+ * CoqUp: Verified high-level synthesis.
+ * Copyright (C) 2019-2020 Yann Herklotz <yann@yannherklotz.com>
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ *)
+
open Verilog
open Extraction
diff --git a/src/Extraction/Extraction.v b/src/Extraction/Extraction.v
index c4248cb..1db8e3c 100644
--- a/src/Extraction/Extraction.v
+++ b/src/Extraction/Extraction.v
@@ -1,3 +1,21 @@
+(*
+ * CoqUp: Verified high-level synthesis.
+ * Copyright (C) 2019-2020 Yann Herklotz <yann@yannherklotz.com>
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ *)
+
Require CoqUp.Verilog.VerilogAST.
Require Import ExtrOcamlBasic.
diff --git a/src/Verilog/PrettyPrint.ml b/src/Verilog/PrettyPrint.ml
index 786d962..9b7750d 100644
--- a/src/Verilog/PrettyPrint.ml
+++ b/src/Verilog/PrettyPrint.ml
@@ -1,3 +1,21 @@
+(*
+ * CoqUp: Verified high-level synthesis.
+ * Copyright (C) 2019-2020 Yann Herklotz <yann@yannherklotz.com>
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ *)
+
open Extraction.VerilogAST
let concat = String.concat ""
@@ -23,7 +41,7 @@ let pprint_binop = function
| Eq -> " == "
| And -> " & "
| Or -> " | "
- | Xor -> "^"
+ | Xor -> " ^ "
let rec pprint_expr = function
| Lit l -> pprint_value l
@@ -33,7 +51,7 @@ let rec pprint_expr = function
| Ternary (c, t, f) -> concat ["("; pprint_expr c; " ? "; pprint_expr t; " : "; pprint_expr f; ")"]
let rec pprint_stmnt i =
- let pprint_case (e, s) = concat [indent (i + 1); pprint_expr e; ":\n"; pprint_stmnt (i+2) s]
+ let pprint_case (e, s) = concat [indent (i + 1); pprint_expr e; ":\n"; pprint_stmnt (i + 2) s]
in function
| Skip -> concat [indent i; ";\n"]
| Block s -> concat [indent i; "begin\n"; fold_map (pprint_stmnt (i+1)) s; indent i; "end\n"]
@@ -41,7 +59,7 @@ let rec pprint_stmnt i =
pprint_stmnt (i + 1) st; indent i; "else\n";
pprint_stmnt (i + 1) sf]
| Case (e, es) -> concat [indent i; "case ("; pprint_expr e; ")\n";
- fold_map pprint_case es; indent i; "endcase"]
+ fold_map pprint_case es; indent i; "endcase\n"]
| Blocking (a, b) -> concat [indent i; pprint_expr a; " = "; pprint_expr b; ";\n"]
| Nonblocking (a, b) -> concat [indent i; pprint_expr a; " <= "; pprint_expr b; ";\n"]
diff --git a/src/Verilog/PrettyPrint.mli b/src/Verilog/PrettyPrint.mli
index 843feec..a8b6e01 100644
--- a/src/Verilog/PrettyPrint.mli
+++ b/src/Verilog/PrettyPrint.mli
@@ -1 +1,19 @@
+(*
+ * CoqUp: Verified high-level synthesis.
+ * Copyright (C) 2019-2020 Yann Herklotz <yann@yannherklotz.com>
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ *)
+
val prettyprint : Extraction.VerilogAST.verilog -> string
diff --git a/src/Verilog/VerilogAST.v b/src/Verilog/VerilogAST.v
index 0c2b38b..362fe45 100644
--- a/src/Verilog/VerilogAST.v
+++ b/src/Verilog/VerilogAST.v
@@ -1,3 +1,21 @@
+(*
+ * CoqUp: Verified high-level synthesis.
+ * Copyright (C) 2019-2020 Yann Herklotz <yann@yannherklotz.com>
+ *
+ * This program 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+ *)
+
From Coq Require Import Lists.List Strings.String.
From Coq Require Import
Structures.OrderedTypeEx