diff options
author | Yann Herklotz <git@yannherklotz.com> | 2020-09-03 02:29:01 +0100 |
---|---|---|
committer | Yann Herklotz <git@yannherklotz.com> | 2020-09-03 02:29:01 +0100 |
commit | f818b4d91ef39923ae0f0b0fb4bbd9fa919f47b0 (patch) | |
tree | 6009c4b3862e0ca884d1193ea6ded4c69ab86fec /src/hls/HTLSchedulegen.v | |
parent | 03d33623bdb9e507525d7ea191fa5ba6eff9d6dd (diff) | |
download | vericert-kvx-f818b4d91ef39923ae0f0b0fb4bbd9fa919f47b0.tar.gz vericert-kvx-f818b4d91ef39923ae0f0b0fb4bbd9fa919f47b0.zip |
Add scheduling
Diffstat (limited to 'src/hls/HTLSchedulegen.v')
-rw-r--r-- | src/hls/HTLSchedulegen.v | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/hls/HTLSchedulegen.v b/src/hls/HTLSchedulegen.v new file mode 100644 index 0000000..1ae3bf6 --- /dev/null +++ b/src/hls/HTLSchedulegen.v @@ -0,0 +1,42 @@ +(* + * Vericert: Verified high-level synthesis. + * Copyright (C) 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 Require Import Maps. +From compcert Require Errors Globalenvs Integers. +From compcert Require Import AST. +From vericert Require Import RTLBlock Verilog HTL Vericertlib AssocMap ValueInt Statemonad. + +Parameter transl_module : function -> Errors.res module. + +Definition transl_fundef := transf_partial_fundef transl_module. + +Definition main_is_internal (p : RTLBlock.program) : bool := + let ge := Globalenvs.Genv.globalenv p in + match Globalenvs.Genv.find_symbol ge p.(AST.prog_main) with + | Some b => + match Globalenvs.Genv.find_funct_ptr ge b with + | Some (AST.Internal _) => true + | _ => false + end + | _ => false + end. + +Definition transl_program (p : RTLBlock.program) : Errors.res HTL.program := + if main_is_internal p + then transform_partial_program transl_fundef p + else Errors.Error (Errors.msg "Main function is not Internal."). |