Fix translation of module path connection type in vlog95 target.

The target API needed to be changed to pass the connection type
through to the target code generator.
This commit is contained in:
Martin Whitaker 2020-04-02 12:40:59 +01:00
parent a44ffe5746
commit 3f49dfcd97
9 changed files with 43 additions and 12 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998-2019 Stephen Williams (steve@icarus.com)
* Copyright (c) 1998-2020 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -350,6 +350,10 @@ void NetDelaySrc::dump(ostream&o, unsigned ind) const
if (has_condit()) o << " if";
else o << " ifnone";
}
if (parallel_)
o << " parallel";
else
o << " full";
o << " src "
<< "(" << transition_delays_[IVL_PE_01]
<< "," << transition_delays_[IVL_PE_10]

View File

@ -5628,7 +5628,7 @@ void PSpecPath::elaborate(Design*des, NetScope*scope) const
NetDelaySrc*path = new NetDelaySrc(scope, scope->local_symbol(),
src.size(), condit_sig,
conditional);
conditional, !full_flag_);
path->set_line(*this);
// The presence of the data_source_expression indicates

View File

@ -1,7 +1,7 @@
#ifndef IVL_ivl_target_H
#define IVL_ivl_target_H
/*
* Copyright (c) 2000-2017 Stephen Williams (steve@icarus.com)
* Copyright (c) 2000-2020 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -524,6 +524,10 @@ extern ivl_island_t ivl_branch_island(ivl_branch_t obj);
* ivl_path_is_condit
* Is this a conditional structure? Needed for ifnone.
*
* ivl_path_is_parallel
* This returns true if the path is a parallel connection and
* false if the path is a full connection.
*
* ivl_path_source_posedge
* ivl_path_source_negedge
* These functions return true if the source is edge sensitive.
@ -534,6 +538,8 @@ extern uint64_t ivl_path_delay(ivl_delaypath_t obj, ivl_path_edge_t pt);
extern ivl_nexus_t ivl_path_condit(ivl_delaypath_t obj);
extern int ivl_path_is_condit(ivl_delaypath_t obj);
extern int ivl_path_is_parallel(ivl_delaypath_t obj);
extern int ivl_path_source_posedge(ivl_delaypath_t obj);
extern int ivl_path_source_negedge(ivl_delaypath_t obj);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998-2017 Stephen Williams (steve@icarus.com)
* Copyright (c) 1998-2020 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -309,11 +309,12 @@ unsigned NetBus::find_link(const Link&that) const
}
NetDelaySrc::NetDelaySrc(NetScope*s, perm_string n, unsigned npins,
bool condit_src, bool conditional)
bool condit_src, bool conditional, bool parallel)
: NetObj(s, n, npins + (condit_src?1:0))
{
condit_flag_ = false;
conditional_ = conditional;
parallel_ = parallel;
posedge_ = false;
negedge_ = false;
for (unsigned idx = 0 ; idx < npins ; idx += 1) {
@ -472,6 +473,11 @@ const Link& NetDelaySrc::condit_pin() const
return pin(pin_count()-1);
}
bool NetDelaySrc::is_parallel() const
{
return parallel_;
}
PortType::Enum PortType::merged( Enum lhs, Enum rhs )
{
if( lhs == NOT_A_PORT || rhs == NOT_A_PORT )

View File

@ -1,7 +1,7 @@
#ifndef IVL_netlist_H
#define IVL_netlist_H
/*
* Copyright (c) 1998-2019 Stephen Williams (steve@icarus.com)
* Copyright (c) 1998-2020 Stephen Williams (steve@icarus.com)
* Copyright CERN 2013 / Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
@ -554,7 +554,7 @@ class NetDelaySrc : public NetObj {
public:
explicit NetDelaySrc(NetScope*s, perm_string n, unsigned nsrc,
bool condit_src, bool conditional);
bool condit_src, bool conditional, bool parallel);
~NetDelaySrc();
// These functions set the delays from the values in the
@ -590,12 +590,15 @@ class NetDelaySrc : public NetObj {
Link&condit_pin();
const Link&condit_pin() const;
bool is_parallel() const;
void dump(ostream&, unsigned ind) const;
private:
uint64_t transition_delays_[12];
bool condit_flag_;
bool conditional_;
bool parallel_;
bool posedge_;
bool negedge_;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000-2019 Stephen Williams (steve@icarus.com)
* Copyright (c) 2000-2020 Stephen Williams (steve@icarus.com)
* Copyright CERN 2013 / Stephen Williams (steve@icarus.com)
* Copyright (c) 2016 CERN Michele Castellana (michele.castellana@cern.ch)
*
@ -1929,6 +1929,12 @@ extern "C" int ivl_path_is_condit(ivl_delaypath_t obj)
return obj->conditional ? 1 : 0;
}
extern "C" int ivl_path_is_parallel(ivl_delaypath_t obj)
{
assert(obj);
return obj->parallel ? 1 : 0;
}
extern uint64_t ivl_path_delay(ivl_delaypath_t obj, ivl_path_edge_t edg)
{
assert(obj);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000-2019 Stephen Williams (steve@icarus.com)
* Copyright (c) 2000-2020 Stephen Williams (steve@icarus.com)
* Copyright CERN 2013 / Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
@ -2793,6 +2793,7 @@ bool dll_target::signal_paths(const NetNet*net)
obj->path[ptr].src = nex->t_cookie();
obj->path[ptr].condit = path_condit;
obj->path[ptr].conditional = src->is_condit();
obj->path[ptr].parallel = src->is_parallel();
obj->path[ptr].posedge = src->is_posedge();
obj->path[ptr].negedge = src->is_negedge();
for (unsigned pe = 0 ; pe < 12 ; pe += 1) {

View File

@ -1,7 +1,7 @@
#ifndef IVL_t_dll_H
#define IVL_t_dll_H
/*
* Copyright (c) 2000-2017 Stephen Williams (steve@icarus.com)
* Copyright (c) 2000-2020 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -206,6 +206,7 @@ struct ivl_delaypath_s {
ivl_nexus_t src;
ivl_nexus_t condit;
bool conditional;
bool parallel;
bool posedge;
bool negedge;
uint64_t delay[12];

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2019 Cary R. (cygcary@yahoo.com)
* Copyright (C) 2010-2020 Cary R. (cygcary@yahoo.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
@ -798,7 +798,11 @@ static void emit_specify_paths(ivl_scope_t scope, ivl_signal_t sig)
has_edge = 1;
}
emit_nexus_as_ca(scope, source, 0, 0);
fprintf(vlog_out, " =>");
if (ivl_path_is_parallel(dpath)) {
fprintf(vlog_out, " =>");
} else {
fprintf(vlog_out, " *>");
}
/* The compiler does not keep the source expression for an edge
* sensitive path so add a constant to get the syntax right. */
if (has_edge) {