@@ -7,7 +7,7 @@ mask in the second operand.
7
7
The file [ sag4fun.v] ( sag4fun.v ) provides implementations for 32 and 64 bits:
8
8
9
9
| Verilog Module | Description |
10
- | -------------- | -------------------------------------------- |
10
+ | : -------------- | : -------------------------------------------- |
11
11
| SAG4Fun32C | 32-Bit combinatorial logic |
12
12
| SAG4Fun32S | 32-Bit 5-step sequential core |
13
13
| SAG4Fun64C | 64-Bit combinatorial logic |
@@ -41,7 +41,7 @@ reversed order.
41
41
## Variants without reversed order of "goat" bits
42
42
43
43
A variant of the Sheep-And-Goats (SAG) instruction that does not reverse the
44
- order of the unmarked data bits in significantly harder to implement in hardware,
44
+ order of the unmarked data bits is significantly harder to implement in hardware,
45
45
and is thus best emulated using the following sequence of three instructions:
46
46
47
47
```
@@ -61,3 +61,37 @@ sag rd, rs2, rs2
61
61
sag rd, rs1, rd
62
62
isg rd, rd, rs2
63
63
```
64
+
65
+ ## Verilog Core Interface
66
+
67
+ The combinatorial cores SAG4Fun32C and SAG4Fun64C have the following interface:
68
+
69
+ | Port | Description |
70
+ | :------------------------- | :------------------------------------- |
71
+ | ` input ctrl_inv ` | Set to 1 for ISG and DEP, 0 otherwise |
72
+ | ` input ctrl_msk ` | Set to 1 for EXT and DEP, 0 otherwise |
73
+ | ` input [N-1:0] in_data ` | The data operand (32 or 64 bits wide) |
74
+ | ` input [N-1:0] in_mask ` | The mask operand (32 or 64 bits wide) |
75
+ | ` output [N-1:0] out_data ` | The result |
76
+
77
+ The sequential cores have only one data input and provide a "load mask" mode
78
+ for loading a new mask. Loading a mask requires the same number of cycles
79
+ as processing a data word (5, 6, or 3 cycles for SAG4Fun32S, SAG4Fun64S,
80
+ and SAG4Fun64F respectively).
81
+
82
+ | Port | Description |
83
+ | :------------------------- | :----------------------------------------- |
84
+ | ` input clock ` | The (positive edge) clock |
85
+ | ` input reset ` | The (high-active, synchronous) reset |
86
+ | ` input ctrl_start ` | Start a new operation (abort current one) |
87
+ | ` output ctrl_ready ` | Signal that last operation finished |
88
+ | ` input ctrl_inv ` | Set to 1 for ISG and DEP, 0 otherwise |
89
+ | ` input ctrl_msk ` | Set to 1 for EXT and DEP, 0 otherwise |
90
+ | ` input ctrl_ldm ` | Set to 1 for loading a new mask |
91
+ | ` input [N-1:0] in_data ` | The data input (32 or 64 bits wide) |
92
+ | ` output [N-1:0] out_data ` | The result (valid when ` ctrl_ready ` is 1) |
93
+
94
+ The control inputs ` ctrl_inv ` and ` ctrl_msk ` should be set to 0 in ` ctrl_ldm `
95
+ mode.
96
+
97
+ ![ SAG4Fun Example Waveform] ( waveform.png )
0 commit comments