Project

General

Profile

Actions

Bug #4997

closed

Неправильно работают конструкции: replication, concatenation

Added by Павел Шестаков almost 10 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
06/18/2014
Due date:
% Done:

0%

Estimated time:
Detected in build:
svn
Platform:
Published in build:
r323

Description

Возникают следующие проблемы при трансляции из Verilog в Verilog
1)Concatenation:
Вход: a = {b,c};
Выход: a = b;
Ожидаемый выход: a = {b,c};
2)Replication:
Вход: a = {2{b}};
Выход: a = (2{b});
Ожидаемый выход: a = {2{b}};

Вход: a = {b, 2{c}};
Выход: программа падает.
Ожидаемый выход: a = {b, 2{c}};
Вход: a = {2{b}, c};
Выход: программа падает.
Ожидаемый выход: a = {2{b}, c};
Вход: a = {2{b}, 2{c}};
Выход: программа падает.
Ожидаемый выход: a = {2{b}, 2{c}};
Actions #1

Updated by Павел Шестаков almost 10 years ago

  • Priority changed from Immediate to Normal
Actions #2

Updated by Sergey Smolov almost 10 years ago

Павел, необходимо уточнить, какая именно программа падает и с какой именно ошибкой. А также способ запуска этой программы.
Без этих данных понять, что именно не работает, затруднительно.

Actions #3

Updated by Alexander Kamkin almost 10 years ago

Сережа, я понял, что имеется в виду. Выйду из отпуска, исправлю.

Actions #4

Updated by Alexander Kamkin almost 10 years ago

  • Subject changed from В проекте Retrascope неправильно работают конструкции: replication, concatenation, repeat to [verilog][translator] В проекте Retrascope неправильно работают конструкции: replication, concatenation, repeat
Actions #5

Updated by Alexander Kamkin almost 10 years ago

  • Target version set to 0.1
Actions #6

Updated by Alexander Kamkin almost 10 years ago

  • Subject changed from [verilog][translator] В проекте Retrascope неправильно работают конструкции: replication, concatenation, repeat to [verilog][translator][ast] В проекте Retrascope неправильно работают конструкции: replication, concatenation, repeat
Actions #7

Updated by Alexander Kamkin almost 10 years ago

  • Description updated (diff)
Actions #8

Updated by Alexander Kamkin almost 10 years ago

  • Project changed from Retrascope to Verilog Translator
  • Subject changed from [verilog][translator][ast] В проекте Retrascope неправильно работают конструкции: replication, concatenation, repeat to Неправильно работают конструкции: replication, concatenation
  • Target version deleted (0.1)
Actions #9

Updated by Alexander Kamkin almost 10 years ago

  • Target version set to 0.1
Actions #10

Updated by Alexander Kamkin almost 10 years ago

Ошибка 2.1 - это помарка в принтере. Исправлено:

  public void onExprBegin(NodeExpr expr) {
    final Enum<?> op = expr.getOperationId();

    if (op == Expression.Type.FUNCTION_CALL) {
      final Expression expression = (Expression) expr.getUserData();
      buffer.append(expression.getPath());
    }

    final boolean curly =
        (op == StandardOperation.BVCONCAT)
     || (op == StandardOperation.BVREPEAT);

    buffer.append(curly ? "{" : "(");
  }

  public void onExprEnd(NodeExpr expr) {
    final Enum<?> op = expr.getOperationId();

    final boolean curly =
        (op == StandardOperation.BVCONCAT)
     || (op == StandardOperation.BVREPEAT);

    buffer.append(curly ? "}" : ")");
  }
Actions #11

Updated by Alexander Kamkin almost 10 years ago

Ошибки 2.2-2.4 некорректны, ибо входные данные не соответствуют синтаксису Verilog (см. стандарт): вместо 2{x} нужно писать {2{x}}.

Actions #12

Updated by Alexander Kamkin almost 10 years ago

  • Status changed from Open to Resolved
  • Published in build set to r323

Ошибка 1 связана с избыточностью полей класса Expression: возможны ситуации, когда variable != null и expression != null.

Actions #13

Updated by Alexander Kamkin over 9 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF