From 75af84521208aac70375d7df45105256475d75b6 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Mon, 17 Feb 2020 18:47:26 +0000 Subject: Update license to be compatible with CompCert --- src/Common/Helper.v | 18 ++++++++++++++++++ src/Common/Show.v | 18 ++++++++++++++++++ src/Common/Tactics.v | 39 ++++++++++++++++++++++++++------------- src/Driver/CompCert.v | 18 ++++++++++++++++++ src/Driver/Driver.ml | 18 ++++++++++++++++++ src/Extraction/Extraction.v | 18 ++++++++++++++++++ src/Verilog/PrettyPrint.ml | 24 +++++++++++++++++++++--- src/Verilog/PrettyPrint.mli | 18 ++++++++++++++++++ src/Verilog/VerilogAST.v | 18 ++++++++++++++++++ 9 files changed, 173 insertions(+), 16 deletions(-) (limited to 'src') 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 + * + * 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 . + *) + 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 + * + * 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 . + *) + 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 + * + * 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 . + *) - 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 + * + * 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 . + *) + 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 + * + * 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 . + *) + 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 + * + * 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 . + *) + 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 + * + * 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 . + *) + 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 + * + * 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 . + *) + 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 + * + * 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 . + *) + From Coq Require Import Lists.List Strings.String. From Coq Require Import Structures.OrderedTypeEx -- cgit