//=============================================================================
|
//=============================================================================
|
// CALL NEAR
|
// CALL NEAR
|
//
|
//
|
//
|
//
|
// 2009-2012 Robert Finch
|
// 2009-2013 Robert Finch
|
// Stratford
|
// Stratford
|
// robfinch<remove>@opencores.org
|
// robfinch<remove>@finitron.ca
|
//
|
//
|
//
|
//
|
// This source file is free software: you can redistribute it and/or modify
|
// This source file is free software: you can redistribute it and/or modify
|
// it under the terms of the GNU Lesser General Public License as published
|
// it under the terms of the GNU Lesser General Public License as published
|
// by the Free Software Foundation, either version 3 of the License, or
|
// by the Free Software Foundation, either version 3 of the License, or
|
// (at your option) any later version.
|
// (at your option) any later version.
|
//
|
//
|
// This source file is distributed in the hope that it will be useful,
|
// This source file is distributed in the hope that it will be useful,
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
//
|
//
|
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
//
|
//
|
//
|
//
|
//=============================================================================
|
//=============================================================================
|
//
|
//
|
CALL:
|
CALL:
|
begin
|
begin
|
`INITIATE_STACK_WRITE
|
write(`CT_WRMEM,sssp,ip[15:8]);
|
lock_o <= 1'b1;
|
lock_o <= 1'b1;
|
dat_o <= ip[15:8];
|
|
state <= CALL1;
|
state <= CALL1;
|
end
|
end
|
CALL1:
|
CALL1:
|
if (ack_i) begin
|
if (ack_i) begin
|
state <= CALL2;
|
state <= CALL2;
|
`PAUSE_STACK_WRITE
|
pause_stack_push();
|
end
|
end
|
CALL2:
|
CALL2:
|
begin
|
begin
|
state <= CALL3;
|
state <= CALL3;
|
`INITIATE_STACK_WRITE
|
write(`CT_WRMEM,sssp,ip[7:0]);
|
dat_o <= ip[7:0];
|
|
end
|
end
|
CALL3:
|
CALL3:
|
if (ack_i) begin
|
if (ack_i) begin
|
`TERMINATE_CYCLE
|
nack();
|
lock_o <= 1'b0;
|
lock_o <= 1'b0;
|
ip <= ip + disp16;
|
ip <= ip + disp16;
|
state <= IFETCH;
|
state <= IFETCH;
|
end
|
end
|
|
|