Learning BSV‎ > ‎Attributes‎ > ‎

Output Port Renaming Attribute

The Bluespec compiler provides a default name for the output port generated for value methods and ActionValue methods. The attribute result= allows the designer to specify a string for the name of the output port. This is useful when the port names must begin with an upper case letter, which is not a valid method name.

Default Naming

output port name: methodname

Attribute Syntax

(* result= "outputportname" *)
method type methodname (arguments) ;

The string outputportname is the name to be generated for the output port. The result= attribute is ignored if the method is an Action method which does not return a result.

BSV Example

interface GrabAndGive;               
method Action grab(Bit#(8) value);
(*result="OUT" *)
method Bit#(8) give();

Generated Verilog

 // action method grab
input [7 : 0] grab_value;
input EN_grab;
output RDY_grab;

// value method give
output [7 : 0] OUT; //output renamed OUT instead of give
output RDY_give;