summaryrefslogtreecommitdiffhomepage
path: root/digital/asserv/src/hdlcounter
diff options
context:
space:
mode:
authorNicolas Schodet2008-04-06 23:20:29 +0200
committerNicolas Schodet2008-04-06 23:20:29 +0200
commit0c3d1233036801045c8fc73ccb6fa45c7795ca53 (patch)
tree2d2b2e85cb3322d8a1a5cd005b320a3dfc217b3a /digital/asserv/src/hdlcounter
parent9c5a02720e24002720ba9ec1f8168d1658187d13 (diff)
* digital/asserv:
- more encoders tests.
Diffstat (limited to 'digital/asserv/src/hdlcounter')
-rw-r--r--digital/asserv/src/hdlcounter/counter_index_test.v14
1 files changed, 7 insertions, 7 deletions
diff --git a/digital/asserv/src/hdlcounter/counter_index_test.v b/digital/asserv/src/hdlcounter/counter_index_test.v
index fcfc2355..1d806c35 100644
--- a/digital/asserv/src/hdlcounter/counter_index_test.v
+++ b/digital/asserv/src/hdlcounter/counter_index_test.v
@@ -40,14 +40,14 @@ module counter_top(clk, rst, q0, q1, q2, q3, ale, rd, wr, ad, i0, i1, ioa,
input [3:0] ioa, ioc;
wire [1:0] qf0;
- wire [size-1:0] count0;
+ wire [15:0] count0;
// Decode encoders outputs.
noise_filter f0[1:0] (clk, rst, q0, qf0);
- quad_decoder_div4 qd0 (clk, rst, qf0, count0);
+ quad_decoder_div4 #(16) qd0 (clk, rst, qf0, count0);
reg [size-1:0] lcount;
- reg [size-1:0] sample;
+ reg [15:0] sample;
// Sample on index pulse.
always @(posedge clk or negedge rst) begin
@@ -66,10 +66,10 @@ module counter_top(clk, rst, q0, q1, q2, q3, ale, rd, wr, ad, i0, i1, ioa,
if (!rst)
lcount <= 0;
else begin
- lcount <= ad[1:0] == 0 ? count0 :
- ad[1:0] == 1 ? 0 :
- ad[1:0] == 2 ? 0 :
- sample;
+ lcount <= ad[1:0] == 0 ? count0[15:8] :
+ ad[1:0] == 1 ? count0[7:0] :
+ ad[1:0] == 2 ? sample[15:8] :
+ sample[7:0];
end
end