Skip to content

Commit

Permalink
Merge branch 'steveicarus:master' into part-select-address-overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
daglem authored Aug 26, 2024
2 parents 0e8fe1c + 8c56b2d commit 056145e
Show file tree
Hide file tree
Showing 118 changed files with 1,366 additions and 356 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,23 @@ on:
- master
# All pull_requests trigger a retest.
pull_request:
workflow_dispatch:

jobs:

mac:
strategy:
fail-fast: false
runs-on: macos-latest
runs-on: macos-12
name: '🍏 macOS'
steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install dependencies
run: |
brew install bison
pip3 install docopt
pip3 install --break-system-packages docopt
- name: Build, check and install
run: |
Expand All @@ -42,18 +43,19 @@ jobs:
matrix:
os: [
'20.04',
'22.04'
'22.04',
'24.04'
]
runs-on: ubuntu-${{ matrix.os }}
name: '🐧 Ubuntu ${{ matrix.os }}'
steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt update -qq
sudo apt install -y make g++ git bison flex gperf libreadline-dev autoconf python3-sphinx python3-docopt
sudo apt install -y make g++ git bison flex gperf libreadline-dev libbz2-dev autoconf python3-sphinx python3-docopt
- name: Build, check and install
run: |
Expand Down Expand Up @@ -89,7 +91,7 @@ jobs:
- run: git config --global core.autocrlf input
shell: bash

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: msys2/setup-msys2@v2
with:
Expand All @@ -102,7 +104,7 @@ jobs:
python-pip
mingw-w64-${{ matrix.arch }}-toolchain
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '>=3.5'

Expand All @@ -118,7 +120,7 @@ jobs:
run: |
./.github/test.sh
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.msystem }}-${{ matrix.arch }}
path: msys2/*.zst
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ cscope.*

# Object files and libraries
*.[oa]
*.so

gmon*.out
gmon*.txt
Expand Down
6 changes: 3 additions & 3 deletions PEvent.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004-2019 Stephen Williams ([email protected])
* Copyright (c) 2004-2024 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
Expand All @@ -21,8 +21,8 @@

# include "PEvent.h"

PEvent::PEvent(perm_string n)
: name_(n)
PEvent::PEvent(perm_string n, unsigned lexical_pos)
: name_(n), lexical_pos_(lexical_pos)
{
}

Expand Down
7 changes: 5 additions & 2 deletions PEvent.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef IVL_PEvent_H
#define IVL_PEvent_H
/*
* Copyright (c) 2000-2019 Stephen Williams ([email protected])
* Copyright (c) 2000-2024 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
Expand Down Expand Up @@ -36,17 +36,20 @@ class PEvent : public PNamedItem {
public:
// The name is a perm-allocated string. It is the simple name
// of the event, without any scope.
explicit PEvent(perm_string name);
explicit PEvent(perm_string name, unsigned lexical_pos);
~PEvent();

perm_string name() const;

unsigned lexical_pos() const { return lexical_pos_; }

void elaborate_scope(Design*des, NetScope*scope) const;

SymbolType symbol_type() const;

private:
perm_string name_;
unsigned lexical_pos_;

private: // not implemented
PEvent(const PEvent&);
Expand Down
18 changes: 9 additions & 9 deletions PExpr.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998-2021 Stephen Williams <[email protected]>
* Copyright (c) 1998-2024 Stephen Williams <[email protected]>
* Copyright CERN 2013 / Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
Expand Down Expand Up @@ -360,19 +360,19 @@ const verireal& PEFNumber::value() const
return *value_;
}

PEIdent::PEIdent(const pform_name_t&that)
: path_(that), no_implicit_sig_(false)
PEIdent::PEIdent(const pform_name_t&that, unsigned lexical_pos)
: path_(that), lexical_pos_(lexical_pos), no_implicit_sig_(false)
{
}

PEIdent::PEIdent(perm_string s, bool no_implicit_sig)
: no_implicit_sig_(no_implicit_sig)
PEIdent::PEIdent(perm_string s, unsigned lexical_pos, bool no_implicit_sig)
: lexical_pos_(lexical_pos), no_implicit_sig_(no_implicit_sig)
{
path_.name.push_back(name_component_t(s));
}

PEIdent::PEIdent(PPackage*pkg, const pform_name_t&that)
: path_(pkg, that), no_implicit_sig_(true)
PEIdent::PEIdent(PPackage*pkg, const pform_name_t&that, unsigned lexical_pos)
: path_(pkg, that), lexical_pos_(lexical_pos), no_implicit_sig_(true)
{
}

Expand Down Expand Up @@ -426,7 +426,7 @@ void PEIdent::declare_implicit_nets(LexicalScope*scope, NetNet::Type type)

ss = ss->parent_scope();
}
PWire*net = new PWire(name, type, NetNet::NOT_A_PORT);
PWire*net = new PWire(name, lexical_pos_, type, NetNet::NOT_A_PORT);
net->set_file(get_file());
net->set_lineno(get_lineno());
scope->wires[name] = net;
Expand All @@ -440,7 +440,7 @@ void PEIdent::declare_implicit_nets(LexicalScope*scope, NetNet::Type type)
bool PEIdent::has_aa_term(Design*des, NetScope*scope) const
{
symbol_search_results sr;
if (!symbol_search(this, des, scope, path_, &sr))
if (!symbol_search(this, des, scope, path_, lexical_pos_, &sr))
return false;

// Class properties are not considered automatic since a non-blocking
Expand Down
9 changes: 6 additions & 3 deletions PExpr.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,9 @@ class PEFNumber : public PExpr {
class PEIdent : public PExpr {

public:
explicit PEIdent(perm_string, bool no_implicit_sig=false);
explicit PEIdent(PPackage*pkg, const pform_name_t&name);
explicit PEIdent(const pform_name_t&);
explicit PEIdent(perm_string, unsigned lexical_pos, bool no_implicit_sig=false);
explicit PEIdent(PPackage*pkg, const pform_name_t&name, unsigned lexical_pos);
explicit PEIdent(const pform_name_t&, unsigned lexical_pos);
~PEIdent();

// Add another name to the string of hierarchy that is the
Expand Down Expand Up @@ -386,8 +386,11 @@ class PEIdent : public PExpr {

const pform_scoped_name_t& path() const { return path_; }

unsigned lexical_pos() const { return lexical_pos_; }

private:
pform_scoped_name_t path_;
unsigned lexical_pos_;
bool no_implicit_sig_;

private:
Expand Down
4 changes: 3 additions & 1 deletion PScope.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef IVL_PScope_H
#define IVL_PScope_H
/*
* Copyright (c) 2008-2021 Stephen Williams ([email protected])
* Copyright (c) 2008-2024 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
Expand Down Expand Up @@ -121,6 +121,8 @@ class LexicalScope {
bool overridable;
// Whether the parameter is a type parameter
bool type_flag = false;
// The lexical position of the declaration
unsigned lexical_pos = 0;

SymbolType symbol_type() const;
};
Expand Down
5 changes: 3 additions & 2 deletions PWire.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999-2021 Stephen Williams ([email protected])
* Copyright (c) 1999-2024 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
Expand All @@ -25,10 +25,11 @@
using namespace std;

PWire::PWire(perm_string n,
unsigned lp,
NetNet::Type t,
NetNet::PortType pt,
PWSRType rt)
: name_(n), type_(t), port_type_(pt), signed_(false),
: name_(n), lexical_pos_(lp), type_(t), port_type_(pt), signed_(false),
port_set_(false), net_set_(false), is_scalar_(false),
error_cnt_(0), discipline_(0)
{
Expand Down
10 changes: 8 additions & 2 deletions PWire.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef IVL_PWire_H
#define IVL_PWire_H
/*
* Copyright (c) 1998-2021 Stephen Williams ([email protected])
* Copyright (c) 1998-2024 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
Expand Down Expand Up @@ -55,13 +55,16 @@ class PWire : public PNamedItem {

public:
PWire(perm_string name,
unsigned lexical_pos,
NetNet::Type t,
NetNet::PortType pt,
PWSRType rt = SR_NET);

// Return a hierarchical name.
perm_string basename() const;

unsigned lexical_pos() const { return lexical_pos_; }

NetNet::Type get_wire_type() const;
bool set_wire_type(NetNet::Type);

Expand All @@ -88,7 +91,7 @@ class PWire : public PNamedItem {
// Write myself to the specified stream.
void dump(std::ostream&out, unsigned ind=4) const;

NetNet* elaborate_sig(Design*, NetScope*scope) const;
NetNet* elaborate_sig(Design*, NetScope*scope);

SymbolType symbol_type() const;

Expand All @@ -99,13 +102,16 @@ class PWire : public PNamedItem {

private:
perm_string name_;
unsigned lexical_pos_;
NetNet::Type type_;
NetNet::PortType port_type_;
bool signed_;

// Whether the wire is variable declared with the const keyword.
bool is_const_ = false;

bool is_elaborating_ = false;

// These members hold expressions for the bit width of the
// wire. If they do not exist, the wire is 1 bit wide. If they
// do exist, they represent the packed dimensions of the
Expand Down
10 changes: 5 additions & 5 deletions Statement.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998-2021 Stephen Williams ([email protected])
* Copyright (c) 1998-2024 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
Expand Down Expand Up @@ -396,17 +396,17 @@ PReturn::~PReturn()
delete expr_;
}

PTrigger::PTrigger(PPackage*pkg, const pform_name_t&ev)
: event_(pkg, ev)
PTrigger::PTrigger(PPackage*pkg, const pform_name_t&ev, unsigned lexical_pos)
: event_(pkg, ev), lexical_pos_(lexical_pos)
{
}

PTrigger::~PTrigger()
{
}

PNBTrigger::PNBTrigger(const pform_name_t&ev, PExpr*dly)
: event_(ev), dly_(dly)
PNBTrigger::PNBTrigger(const pform_name_t&ev, unsigned lexical_pos, PExpr*dly)
: event_(ev), lexical_pos_(lexical_pos), dly_(dly)
{
}

Expand Down
8 changes: 5 additions & 3 deletions Statement.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef IVL_Statement_H
#define IVL_Statement_H
/*
* Copyright (c) 1998-2021 Stephen Williams ([email protected])
* Copyright (c) 1998-2024 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
Expand Down Expand Up @@ -599,26 +599,28 @@ class PReturn : public Statement {
class PTrigger : public Statement {

public:
explicit PTrigger(PPackage*pkg, const pform_name_t&ev);
explicit PTrigger(PPackage*pkg, const pform_name_t&ev, unsigned lexical_pos);
~PTrigger();

virtual NetProc* elaborate(Design*des, NetScope*scope) const;
virtual void dump(std::ostream&out, unsigned ind) const;

private:
pform_scoped_name_t event_;
unsigned lexical_pos_;
};

class PNBTrigger : public Statement {
public:
explicit PNBTrigger(const pform_name_t&ev, PExpr*dly);
explicit PNBTrigger(const pform_name_t&ev, unsigned lexical_pos, PExpr*dly);
~PNBTrigger();

virtual NetProc* elaborate(Design*des, NetScope*scope) const;
virtual void dump(std::ostream&out, unsigned ind) const;

private:
pform_name_t event_;
unsigned lexical_pos_;
PExpr*dly_;
};

Expand Down
12 changes: 10 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,16 @@ case "${host}" in
CFLAGS="-mieee $CFLAGS"
;;
*-*-mingw*)
CXXFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $CXXFLAGS"
CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $CFLAGS"
# The MINGW64/32 environments link to MSVCRT which has stdio issues
# so use the slower, but functional mingw versions for this case.
case "${MSYSTEM}" in
MINGW*)
CXXFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $CXXFLAGS"
CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $CFLAGS"
AC_MSG_NOTICE([${MSYSTEM} needs -D__USE_MINGW_ANSI_STDIO=1])
;;

esac
;;
esac

Expand Down
Loading

0 comments on commit 056145e

Please sign in to comment.