1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071(**********************************************************************)(* *)(* This file is part of the RFSM package *)(* *)(* Copyright (c) 2018-present, Jocelyn SEROT. All rights reserved. *)(* *)(* This source code is licensed under the license found in the *)(* LICENSE file in the root directory of this source tree. *)(* *)(**********************************************************************)(**{1 Host language definition} *)(** Output signature of the functor {!Host.Make} *)moduletypeT=sigmoduleGuest:Guest.TmoduleSyntax:Syntax.SYNTAXmoduleTyping:Typing.TYPINGmoduleStatic:Static.TmoduleDot:Dot.DOTwithmoduleStatic=StaticmoduleDynamic:Dynamic.DYNAMICwithmoduleSyntax=SyntaxandmoduleStatic=StaticmoduleVcd:Vcd.VCDmoduleCtask:Ctask.CTASKwithmoduleStatic=StaticmoduleSystemc:Systemc.SYSTEMCwithmoduleStatic=StaticmoduleVhdl:Vhdl.VHDLwithmoduleStatic=Staticvaltype_program:Typing.env->Syntax.program->Typing.typed_programvaltype_fragment:Syntax.fragment->unitvalscan_fragment:Syntax.fragment->Ident.tlist*Ident.tlist(* List of rd symbols, list of wr symbols *)valelab:Typing.typed_program->Syntax.program->Static.tvalrun:?vcd_file:string->Syntax.program->Static.t->unitvalpp_program:Format.formatter->Syntax.program->unitvalpp_fragment:Format.formatter->Syntax.fragment->unitvalpp_tenv:Format.formatter->Typing.env->unitend(** Functor building the host language implementation given a guest language implementation *)moduleMake(G:Guest.T):TwithmoduleGuest=GandmoduleSyntax=Syntax.Make(G.Syntax)=structmoduleGuest=GmoduleSyntax=Syntax.Make(G.Syntax)moduleTyping=Typing.Make(Syntax)(G.Typing)(G.Static)moduleStatic=Static.Make(Syntax)(Typing)(G.Value)(G.Static)moduleDot=Dot.Make(Static)moduleDynamic=Dynamic.Make(Syntax)(Static)(G.Eval)moduleVcd=Vcd.Make(Dynamic.EvSeq)moduleCmodel=Cmodel.Make(Static)moduleCtask=Ctask.Make(Static)(G.Ctask)moduleSystemc=Systemc.Make(Static)(G.Systemc)moduleVhdl=Vhdl.Make(Static)(G.Vhdl)lettype_programtenvp=Typing.type_programtenvplettype_fragmentp=Typing.type_fragmentpletscan_fragmentp=Syntax.check_fragmentpletelabtpp=Static.buildtppletrun?(vcd_file="")ps=letrs=Dynamic.runpsinifvcd_file<>""thenbeginVcd.output~fname:vcd_filers;Printf.fprintfstdout"Wrote %s\n"vcd_fileendletpp_programp=Syntax.pp_programpletpp_fragmentp=Syntax.pp_fragmentpletpp_tenvfmtte=Typing.pp_envfmtteend