Your source code will be much easier to read when it is formatted nice and pretty like this:
class packet;
rand bit [31:0] data;
rand bit [31:0] address;
rand bit [7:0] length;
rand bit [7:0] data[];
constraint max_length {
length == data.size();
}
endclass: packet
instead of:
class packet;
rand bit [31:0] data;
rand bit [31:0] address;
rand bit [7:0] length;
rand bit [7:0] data[];
constraint max_length {
length == data.size();
}
endclass: packet
All you have to do is embed your code between [code] and [/code] tags, like this: (or use the <> button above the text input form)
[code]class packet;
rand bit [31:0] data;
rand bit [31:0] address;
rand bit [7:0] length;
rand bit [7:0] data[];
constraint max_length {
length == data.size();
}
endclass: packet[/code]
You can also get syntax highlighting with tags [systemverilog] and [/systemverilog]
class packet;
rand bit [31:0] data;
rand bit [31:0] address;
rand bit [7:0] length;
rand bit [7:0] data[];
constraint max_length {
length == data.size();
}
endclass: packet
You can also select the text you want to codify first, then click the <> button on the toolbar above the text editing pane.