Project

General

Profile

« Previous | Next » 

Revision d3a35600

Added by Arnaud Dieumegard almost 6 years ago

Conditional signals selection, waveform with delay

View differences:

src/backends/VHDL/vhdl_ast.ml
162 162
let rel_funs   = ["<";">";"<=";">=";"/=";"=";"?=";"?/=";"?<";"?<=";"?>";"?>=";"??"]
163 163
let shift_funs = ["sll";"srl";"sla";"sra";"rol";"ror"]
164 164

  
165
type vhdl_waveform_element_t =
166
  {
167
    value: vhdl_expr_t option [@default None];
168
    delay: vhdl_expr_t option [@default None];
169
  }
170
[@@deriving show { with_path = false }, yojson {strict = false}];;
171

  
165 172
type vhdl_sequential_stmt_t = 
166 173
  | VarAssign of { label: vhdl_name_t [@default NoName]; lhs: vhdl_name_t; rhs: vhdl_expr_t } [@name "VARIABLE_ASSIGNMENT_STATEMENT"]
167
  | SigSeqAssign of { label: vhdl_name_t [@default NoName]; lhs: vhdl_name_t; rhs: vhdl_expr_t list} [@name "SIGNAL_ASSIGNMENT_STATEMENT"]
174
  | SigSeqAssign of { label: vhdl_name_t [@default NoName]; lhs: vhdl_name_t; rhs: vhdl_waveform_element_t list} [@name "SIGNAL_ASSIGNMENT_STATEMENT"]
168 175
  | If of { label: vhdl_name_t [@default NoName]; if_cases: vhdl_if_case_t list;
169 176
    default: vhdl_sequential_stmt_t list [@default []]; } [@name "IF_STATEMENT"]
170 177
  | Case of { label: vhdl_name_t [@default NoName]; guard: vhdl_expr_t; branches: vhdl_case_item_t list } [@name "CASE_STATEMENT_TREE"]
......
245 252

  
246 253
type vhdl_signal_condition_t =
247 254
  {                            
248
    expr: vhdl_expr_t list;              (* when expression *)
255
    expr: vhdl_waveform_element_t list [@default []];              (* when expression *)
249 256
    cond: vhdl_expr_t [@default IsNull];  (* optional else case expression. 
250 257
                                             If None, could be a latch  *)
251 258
  }
......
253 260

  
254 261
type vhdl_signal_selection_t =
255 262
  {
256
    expr : vhdl_expr_t;
263
    expr : vhdl_waveform_element_t list [@default []];
257 264
    when_sel: vhdl_expr_t list [@default []];
258 265
  }
259 266
[@@deriving show { with_path = false }, yojson {strict = false}];;
......
283 290
    postponed: bool [@default false];
284 291
    label: vhdl_name_t [@default NoName];
285 292
    lhs: vhdl_name_t;      (* assigned signal = target *)
286
    sel: vhdl_expr_t;  
293
    sel: vhdl_expr_t;
287 294
    branches: vhdl_signal_selection_t list [@default []];
288
    delay: vhdl_expr_t option;
295
    delay: vhdl_expr_t option [@default None];
289 296
  }
290 297
[@@deriving show { with_path = false }, yojson {strict = false}];;
291 298

  

Also available in: Unified diff