Languages

CommunityCategory: XMODELConverting an xbit/bit signal to an xreal signal with variable levels
SA Support Team Staff asked 4 years ago

I know the 'xbit_to_xreal' primitive converts an 'xbit'-type digital signal to an 'xreal'-type analog signal, and its parameters 'level1' and 'level0' define the logic-1 and logic-0 levels, respectively. However, in my design, the supply voltage can vary, implying that the logic-1 level of the 'xreal'-type output must also vary with the supply voltage. I encountered an error when I tried to assign the 'vdd' signal to the 'level1' parameter of the 'xbit_to_xreal' primitive. Is there a way to convert an xbit signal to an xreal signal with variable levels?

1 Answers
Best Answer
SA Support Team Staff answered 4 years ago

Yes, there is an 'xbit_to_xreal_var' primitive. The 'xbit_to_xreal_var' primitive converts an 'xbit'-type input to an 'xreal'-type output, where its logic-1 and logic-0 levels are defined by the 'level1' and 'level0' input signals, instead of the same-named parameters. In SystemVerilog, the parameters can only take fixed values determined at compile times. This is why you encountered an error when assigning the 'vdd' signal to the 'level1' parameter of the 'xbit_to_xreal' primitive. With the 'xbit_to_xreal_var' primitive, you can assign the 'vdd' signal to its 'level1' input port. Here is an example:

xbit_to_xreal_var INST (.in(in), .out(out), .level1(vdd), .level0(vss));

There are also other connect primitives with variable conversion levels, such as 'xbit_to_real_var', 'bit_to_xreal_var', 'bit_to_real_var', 'real_to_bit_var', 'real_to_xbit_var', 'xreal_to_xbit_var', and 'xreal_to_bit_var'. They all take the 'level1' and 'level0' inputs that define the variable logic-1 and logic-0 levels, respectively.

For additional notes, when GLISTER or MODELZEN inserts connectors to resolve the differences in signal types, it automatically uses the '*_var' primitive when the conversion levels are defined with signal names. For more information, please refer to this Q&A posting.

SA Support Team Staff asked 4 years ago

'xbit_to_xreal' primitive를 사용하면 'xbit' 타입의 디지털 신호를 'xreal' 타입의 아날로그 신호로 변환할 수 있고, 그때 아날로그 신호가 로직 1과 로직 0에 대해 갖는 레벨은 'level1''level0' 파라미터에 의해 정의됨을 알고 있습니다. 하지만, 제 설계에서는 전원 전압이 가변할 수 있고, 그 뜻은 'xreal' 타입 출력신호의 로직 1 레벨이 전원 전압과 함께 변화해야한다는 것을 의미합니다. 이 'xbit_to_xreal' primitive의 'level1' 파라미터 값으로 'vdd' 신호를 주었을때는 에러메시지가 발생하였습니다. xbit 신호를 변동가능한 레벨의 xreal 신호로 변환하려면 어떻게 해야 하나요?

1 Answers
Best Answer
SA Support Team Staff answered 4 years ago

Yes, there is an 'xbit_to_xreal_var' primitive. The 'xbit_to_xreal_var' primitive converts an 'xbit'-type input to an 'xreal'-type output, where its logic-1 and logic-0 levels are defined by the 'level1' and 'level0' input signals, instead of the same-named parameters. In SystemVerilog, the parameters can only take fixed values determined at compile times. This is why you encountered an error when assigning the 'vdd' signal to the 'level1' parameter of the 'xbit_to_xreal' primitive. With the 'xbit_to_xreal_var' primitive, you can assign the 'vdd' signal to its 'level1' input port. Here is an example:

xbit_to_xreal_var INST (.in(in), .out(out), .level1(vdd), .level0(vss));

There are also other connect primitives with variable conversion levels, such as 'xbit_to_real_var', 'bit_to_xreal_var', 'bit_to_real_var', 'real_to_bit_var', 'real_to_xbit_var', 'xreal_to_xbit_var', and 'xreal_to_bit_var'. They all take the 'level1' and 'level0' inputs that define the variable logic-1 and logic-0 levels, respectively.

For additional notes, when GLISTER or MODELZEN inserts connectors to resolve the differences in signal types, it automatically uses the '*_var' primitive when the conversion levels are defined with signal names. For more information, please refer to this Q&A posting.