-- GHDL driver - local commands. -- 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 Ada.Text_IO; use Ada.Text_IO; with Ada.Command_Line; use Ada.Command_Line; with GNAT.Directory_Operations; with Types; use Types; with Libraries; with Std_Package; with Flags; with Name_Table; with Std_Names; with Back_End; with Disp_Vhdl; with Default_Pathes; with Scanner; with Sem; with Canon; with Errorout; with Configuration; with Files_Map; with Post_Sems; with Disp_Tree; with Options; with Iirs_Utils; use Iirs_Utils; package body Ghdllocal is -- Version of the IEEE library to use. This just change pathes. type Ieee_Lib_Kind is (Lib_Standard, Lib_None, Lib_Synopsys, Lib_Mentor); Flag_Ieee : Ieee_Lib_Kind; -- If TRUE, generate 32bits code on 64bits machines. Flag_32bit : Boolean := False; procedure Finish_Compilation (Unit : Iir_Design_Unit; Main : Boolean := False) is use Errorout; Lib_Unit : constant Iir := Get_Library_Unit (Unit); Config : Iir_Design_Unit; begin if (Main or Flags.Dump_All) and then Flags.Dump_Parse then Disp_Tree.Disp_Tree (Unit); end if; if Flags.Verbose then Report_Msg (Msgid_Note, Semantic, +Unit, "analyze %n", (1 => +Lib_Unit)); end if; Sem.Semantic (Unit); if (Main or Flags.Dump_All) and then Flags.Dump_Sem then Disp_Tree.Disp_Tree (Unit); end if; if Errorout.Nbr_Errors > 0 then raise Compilation_Error; end if; if (Main or Flags.List_All) and then Flags.List_Sem then Disp_Vhdl.Disp_Vhdl (Unit); end if; Post_Sems.Post_Sem_Checks (Unit); if Errorout.Nbr_Errors > 0 then raise Compilation_Error; end if; if Flags.Flag_Elaborate or else ((Main or Flags.List_All) and then Flags.List_Canon) then if Flags.Verbose then Report_Msg (Msgid_Note, Semantic, No_Location, "canonicalize %n", (1 => +Lib_Unit)); end if; Canon.Canonicalize (Unit); -- FIXME: for Main only ? if Get_Kind (Lib_Unit) = Iir_Kind_Package_Declaration and then not Get_Need_Body (Lib_Unit) and then Get_Need_Instance_Bodies (Lib_Unit) then -- Create the bodies for instances Set_Package_Instantiation_Bodies_Chain (Lib_Unit, Canon.Create_Instantiation_Bodies (Lib_Unit)); end if; if (Main or Flags.List_All) and then Flags.List_Canon then Disp_Vhdl.Disp_Vhdl (Unit); end if; end if; if Flags.Flag_Elaborate then if Get_Kind (Lib_Unit) = Iir_Kind_Architecture_Body then Config := Canon.Create_Default_Configuration_Declaration (Lib_Unit); Set_Default_Configuration_Declaration (Lib_Unit, Config); end if; end if; end Finish_Compilation; procedure Compile_Init is begin Options.Initialize; Flag_Ieee := Lib_Standard; Back_End.Finish_Compilation := Finish_Compilation'Access; Flag_Verbose := False; end Compile_Init; procedure Init (Cmd : in out Command_Lib) is pragma Unreferenced (Cmd); begin Compile_Init; end Init; procedure Decode_Option (Cmd : in out Command_Lib; Option : String; Arg : String; Res : out Option_Res) is pragma Unreferenced (Cmd); pragma Unreferenced (Arg); Opt : constant String (1 .. Option'Length) := Option; begin Res := Option_Bad; if Opt = "-v" and then Flag_Verbose = False then Flag_Verbose := True; Res := Option_Ok; elsif Opt'Length > 9 and then Opt (1 .. 9) = "--PREFIX=" then Switch_Prefix_Path := new String'(Opt (10 .. Opt'Last)); Res := Option_Ok; elsif Opt = "--ieee=synopsys" then Flag_Ieee := Lib_Synopsys; Res := Option_Ok; elsif Opt = "--ieee=mentor" then Flag_Ieee := Lib_Mentor; Res := Option_Ok; elsif Opt = "--ieee=none" then Flag_Ieee := Lib_None
/*
* yosys -- Yosys Open SYnthesis Suite
*
* Copyright (C) 2012 Clifford Wolf <clifford@clifford.at>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/
// Input buffer map
module \$__inpad (input I, output O);
twentynm_io_ibuf _TECHMAP_REPLACE_ (.o(O), .i(I), .ibar(1'b0));
endmodule
// Output buffer map
module \$__outpad (input I, output O);
twentynm_io_obuf _TECHMAP_REPLACE_ (.o(O), .i(I), .oe(1'b1));
endmodule
// LUT Map
module \$lut (A, Y);
parameter WIDTH = 0;
parameter LUT = 0;
input [WIDTH-1:0] A;
output Y;
generate
if (WIDTH == 1) begin
assign Y = ~A[0]; // Not need to spend 1 logic cell for such an easy function
end else
if (WIDTH == 2) begin
twentynm_lcell_comb #(.lut_mask({16{LUT}}), .shared_arith("off"), .extended_lut("off"))
_TECHMAP_REPLACE_ (.combout(Y), .dataa(A[0]), .datab(A[1]), .datac(1'b1),.datad(1'b1), .datae(1'b1), .dataf(1'b1), .datag(1'b1));
end /*else
if(WIDTH == 3) begin
fiftyfivenm_lcell_comb #(.lut_mask({2{LUT}}), .sum_lutc_input("datac")) _TECHMAP_REPLACE_ (.combout(Y), .dataa(A[0]), .datab(A[1]), .datac(A[2]),.datad(1'b1));
end else
if(WIDTH == 4) begin
fiftyfivenm_lcell_comb #(.lut_mask(LUT), .sum_lutc_input("datac")) _TECHMAP_REPLACE_ (.combout(Y), .dataa(A[0]), .datab(A[1]), .datac(A[2]),.datad(A[3]));
end*/ else
wire _TECHMAP_FAIL_ = 1;
endgenerate
endmodule //