aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/verilog/verilog_parser.y
/*
 *  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.
 *
 */

#include "kernel/register.h"
#include "kernel/sigtools.h"
#include "kernel/log.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <limits.h>

#ifndef _WIN32
#  include <unistd.h>
#  include <dirent.h>
#endif

YOSYS_NAMESPACE_BEGIN

struct Vhdl2verilogPass : public Pass {
	Vhdl2verilogPass() : Pass("vhdl2verilog", "importing VHDL designs using vhdl2verilog") { }
	virtual void help()
	{
		//   |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
		log("\n");
		log("    vhdl2verilog [options] <vhdl-file>..\n");
		log("\n");
		log("This command reads VHDL source files using the 'vhdl2verilog' tool and the\n");
		log("Yosys Verilog frontend.\n");
		log("\n");
		log("    -out <out_file>\n");
		log("        do not import the vhdl2verilog output. instead write it to the\n");
		log("        specified file.\n");
		log("\n");
		log("    -vhdl2verilog_dir <directory>\n");
		log("        do use the specified vhdl2verilog installation. this is the directory\n");
		log("        that contains the setup_env.sh file. when this option is not present,\n");
		log("        it is assumed that vhdl2verilog is in the PATH environment variable.\n");
		log("\n");
		log("    -top <top-entity-name>\n");
		log("        The name of the top entity. This option is mandatory.\n");
		log("\n");
		log("The following options are passed as-is to vhdl2verilog:\n");
		log("\n");
		log("    -arch <architecture_name>\n");
		log("    -unroll_generate\n");
		log("    -nogenericeval\n");
		log("    -nouniquify\n");
		log("    -oldparser\n");
		log("    -suppress <list>\n");
		log("    -quiet\n");
		log("    -nobanner\n");
		log("    -mapfile <file>\n");
		log("\n");
		log("vhdl2verilog can be obtained from:\n");
		log("http://www.edautils.com/vhdl2verilog.html\n");
		log("\n");
	}
	virtual void execute(std::vector<std::string> args, RTLIL::Design *design)
	{
		log_header("Executing VHDL2VERILOG (importing VHDL designs using vhdl2verilog).\n");
		log_push();

		std::string out_file, top_entity;
		std::string vhdl2verilog_dir;
		std::
Commit message (Collapse)AuthorAgeFilesLines
...
| * Add precise locations for assertshuaixv2020-03-191-7/+30
| |
* | Add AST node source location information in a couple more parser rules.Alberto Gonzalez2020-03-171-0/+2
|/
* Merge pull request #1759 from zeldin/constant_with_comment_reduxMiodrag Milanović2020-03-141-11/+20
|\ | | | | refixed parsing of constant with comment between size and value
| * refixed parsing of constant with comment between size and valueMarcus Comstedt2020-03-111-11/+20
| | | | | | | | | | | | The three parts of a based constant (size, base, digits) are now three separate tokens, allowing the linear whitespace (including comments) between them to be treated as normal inter-token whitespace.
* | verilog: also set location for simple_behavioral_stmtEddie Hung2020-03-101-0/+4
| |
* | Set AST source locations in more parser rules.Alberto Gonzalez2020-03-101-2/+49
|/
* Fix partsel expr bit width handling and add test caseClaire Wolf2020-03-081-4/+6
| | | | Signed-off-by: Claire Wolf <claire@symbioticeda.com>
* Fix bison warning for "pure-parser" optionClaire Wolf2020-03-031-1/+11-11/+69
|\ | | | | | | Signed-off-by: Clifford Wolf <clifford@clifford.at>
| * sv: Disambiguate interface portsDavid Shah2019-10-031-3/+19
| | | | | | | | Signed-off-by: David Shah <dave@ds0.me>
| * sv: Fix memories of typedefsDavid Shah2019-10-031-1/+1
| | | | | | | | Signed-off-by: David Shah <dave@ds0.me>
| * sv: Add %expectDavid Shah2019-10-031-0/+1
| | | | | | | | Signed-off-by: David Shah <dave@ds0.me>
| * sv: Add support for memory typedefsDavid Shah2019-10-031-1/+19
| | | | | | | | Signed-off-by: David Shah <dave@ds0.me>
| * sv: Fix typedef parametersDavid Shah2019-10-031-4/+17
| | | | | | | | Signed-off-by: David Shah <dave@ds0.me>
| * sv: Switch parser to glr, prep for typedefDavid Shah2019-10-031-4/+34
|/ | | | Signed-off-by: David Shah <dave@ds0.me>
* substr() -> compare()Eddie Hung2019-08-071-4/+4
|
* Some cleanups in "ignore specify parser"Clifford Wolf2019-07-031-79/+5
| | | | Signed-off-by: Clifford Wolf <clifford@clifford.at>
* Improve specify dummy parser, fixes #1144Clifford Wolf2019-06-281-2/+9
| | | | Signed-off-by: Clifford Wolf <clifford@clifford.at>
* Make genvar a signed typeEddie Hung2019-06-201-0/+1
|
* Merge branch 'unpacked_arrays' of https://github.com/towoe/yosys-sv into ↵Clifford Wolf2019-06-201-1/+7
|\ | | | | | | towoe-unpacked_arrays
| * Unpacked array declaration using sizeTobias Wölfel2019-06-191-1/+7
| | | | | | | | | | | | | | | | Allows fixed-sized array dimension specified by a single number. This commit is based on the work from PeterCrozier https://github.com/YosysHQ/yosys/pull/560. But is split out of the original work.
* | Add "read_verilog -pwires" feature, closes #1106Clifford Wolf2019-06-191-2/+6
| | | | | | | | Signed-off-by: Clifford Wolf <clifford@clifford.at>
* | Add defaultvalue attributeClifford Wolf2019-06-191-0/+11
| | | | | | | | Signed-off-by: Clifford Wolf <clifford@clifford.at>
* | Fix handling of "logic" variables with initial valueClifford Wolf2019-06-191-2/+2
| | | | | | | | Signed-off-by: Clifford Wolf <clifford@clifford.at>
* | Fixed brojen $error()/$info/$warning() on non-generate blocksUdi Finkelstein2019-06-111-2/+12
|/ | | | (within always/initial blocks)
* Merge branch 'pr_elab_sys_tasks' of https://github.com/udif/yosys into ↵Clifford Wolf2019-06-071-1/+10
|\ | | | | | | clifford/pr983
| * Initial implementation of elaboration system tasksUdi Finkelstein2019-05-031-1/+10
| | | | | | | | | | | | | | (IEEE1800-2017 section 20.11) This PR allows us to use $info/$warning/$error/$fatal **at elaboration time** within a generate block. This is very useful to stop a synthesis of a parametrized block when an illegal combination of parameters is chosen.
* | Cleanup tux3-implicit_named_connectionClifford Wolf2019-06-071-1/+1
| | | | | | | | Signed-off-by: Clifford Wolf <clifford@clifford.at>
* | Merge branch 'implicit_named_connection' of https://github.com/tux3/yosys ↵Clifford Wolf2019-06-071-1/+10
|\ \ | | | | | | | | | into tux3-implicit_named_connection
| * | SystemVerilog support for implicit named port connectionstux32019-06-061-9/+17
| | | | | | | | | | | | | | | This is the `foo foo(.port1, .port2);` SystemVerilog syntax introduced in IEEE1800-2005.
* | | Fixed memory leak.Maciej Kurc2019-06-051-0/+4
| | | | | | | | | | | | Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
class="n">Frontend::frontend_call(design, &ff, stringf("%s/vhdl2verilog_output.v", tempdir_name.c_str()), "verilog"); } log_header("Removing temp directory `%s':\n", tempdir_name.c_str()); remove_directory(tempdir_name); log_pop(); } } Vhdl2verilogPass; YOSYS_NAMESPACE_END