Syntax error near "in" of VHDL testbench in ISE14.7 - syntax-error

I am writing a testbench to simulate the component top_tb, but it displays a following syntax error.
XX/selfloop_in_chip_tb.vhd" Line 47: Syntax error near "in".
ERROR:ProjectMgmt - 1 error(s) found while parsing design hierarchy.
I have checked the code for several times, but I still fail to debug it. Could anyone spare time to give me some help? Thank you a lot.
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_signed.all;
ENTITY selfloop_in_chip_tb IS
END selfloop_in_chip_tb;
architecture behavior of selfloop_in_chip_tb is
-- Component Declaration
component top_tb
port(
clkIn : in std_logic;
AD_in_C1 : in std_logic_vector(AD_BITS_NUM-1 downto 0);
AD_in_S1 : in std_logic_vector(AD_BITS_NUM-1 downto 0);
AD_in_C2 : in std_logic_vector(AD_BITS_NUM-1 downto 0);
AD_in_S2 : in std_logic_vector(AD_BITS_NUM-1 downto 0);
DA_out_I1 : out std_logic_vector(DA_BITS_NUM-1 downto 0);
DA_out_Q1 : out std_logic_vector(DA_BITS_NUM-1 downto 0);
DA_out_I2 : out std_logic_vector(DA_BITS_NUM-1 downto 0);
DA_out_Q2 : out std_logic_vector(DA_BITS_NUM-1 downto 0);
src_data_select : in std_logic;
src_data_fromTop : in std_logic;
enc_start_fromTop : in std_logic;
send_en : out std_logic;
--发端
send_frames : out std_logic_vector(23 downto 0);
--收端
recv_frames : out std_logic_vector(23 downto 0);
err_frames : out std_logic_vector(23 downto 0);
ldpc_out_start : out std_logic;
ldpc_out_ena : out std_logic;
ldpc_out_data : out std_logic
);
end component;
--Inputs
-- 信源选择信号
Line 47 signal clkIn : in std_logic := '0';
signal src_data_select : in std_logic := '0';
signal src_data_fromTop : in std_logic := '0';
signal enc_start_fromTop : in std_logic := '0';
signal AD_in_C1 : in std_logic_vector(AD_BITS_NUM-1 downto 0) := (others => '0');
signal AD_in_S1 : in std_logic_vector(AD_BITS_NUM-1 downto 0) := (others => '0');
signal AD_in_C2 : in std_logic_vector(AD_BITS_NUM-1 downto 0) := (others => '0');
signal AD_in_S2 : in std_logic_vector(AD_BITS_NUM-1 downto 0) := (others => '0');
--Outputs
--观测信号
--发端
signal send_frames : out std_logic_vector(23 downto 0);
--收端
signal recv_frames : out std_logic_vector(23 downto 0);
signal err_frames : out std_logic_vector(23 downto 0);
signal ldpc_out_start : out std_logic;
signal ldpc_out_ena : out std_logic;
signal ldpc_out_data : out std_logic;
signal send_en : out std_logic;
signal DA_out_I1 : out std_logic_vector(DA_BITS_NUM-1 downto 0);
signal DA_out_Q1 : out std_logic_vector(DA_BITS_NUM-1 downto 0);
signal DA_out_I2 : out std_logic_vector(DA_BITS_NUM-1 downto 0);
signal DA_out_Q2 : out std_logic_vector(DA_BITS_NUM-1 downto 0);
-- Clock period definitions
constant clkIn_period : time := 7.8125 ns; --128MHz时钟
BEGIN
-- Component Instantiation
uut: top_tb PORT MAP(
clkIn => clkIn,
AD_in_C1 => AD_in_C1,
AD_in_C2 => AD_in_C2,
AD_in_S1 => AD_in_S1,
AD_in_S2 => AD_in_S2,
DA_out_I1 => DA_out_I1,
DA_out_I2 => DA_out_I2,
DA_out_Q1 => DA_out_Q1,
DA_out_Q2 => DA_out_Q2,
src_data_select => src_data_select,
src_data_fromTop => src_data_fromTop,
enc_start_fromTop => enc_start_fromTop,
send_frames => send_frames,
--收端
recv_frames => recv_frames,
err_frames => err_frames,
ldpc_out_start => ldpc_out_start,
ldpc_out_ena => ldpc_out_ena,
ldpc_out_data => ldpc_out_data,
send_en => send_en
);
clkIn_process :process
begin
clkIn <= '0';
wait for clkIn_period/2;
clkIn <= '1';
wait for clkIn_period/2;
end process;
END;

The signals from line 47 can't be declare either as in or as out.
I am guessing this is a bad copy past. simply remove the in/ out of those it will be fine.
here is my fixed file:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_signed.all;
ENTITY selfloop_in_chip_tb IS
END selfloop_in_chip_tb;
architecture behavior of selfloop_in_chip_tb is
-- I had to add those 2 line to compile
constant AD_BITS_NUM : integer := 8;
constant DA_BITS_NUM : integer := 8;
-- Component Declaration
component top_tb
port(
clkIn : in std_logic;
AD_in_C1 : in std_logic_vector(AD_BITS_NUM-1 downto 0);
AD_in_S1 : in std_logic_vector(AD_BITS_NUM-1 downto 0);
AD_in_C2 : in std_logic_vector(AD_BITS_NUM-1 downto 0);
AD_in_S2 : in std_logic_vector(AD_BITS_NUM-1 downto 0);
DA_out_I1 : out std_logic_vector(DA_BITS_NUM-1 downto 0);
DA_out_Q1 : out std_logic_vector(DA_BITS_NUM-1 downto 0);
DA_out_I2 : out std_logic_vector(DA_BITS_NUM-1 downto 0);
DA_out_Q2 : out std_logic_vector(DA_BITS_NUM-1 downto 0);
src_data_select : in std_logic;
src_data_fromTop : in std_logic;
enc_start_fromTop : in std_logic;
send_en : out std_logic;
--发端
send_frames : out std_logic_vector(23 downto 0);
--收端
recv_frames : out std_logic_vector(23 downto 0);
err_frames : out std_logic_vector(23 downto 0);
ldpc_out_start : out std_logic;
ldpc_out_ena : out std_logic;
ldpc_out_data : out std_logic
);
end component;
--Inputs
-- 信源选择信号
signal clkIn : std_logic := '0';
signal src_data_select : std_logic := '0';
signal src_data_fromTop : std_logic := '0';
signal enc_start_fromTop : std_logic := '0';
signal AD_in_C1 : std_logic_vector(AD_BITS_NUM-1 downto 0) := (others => '0');
signal AD_in_S1 : std_logic_vector(AD_BITS_NUM-1 downto 0) := (others => '0');
signal AD_in_C2 : std_logic_vector(AD_BITS_NUM-1 downto 0) := (others => '0');
signal AD_in_S2 : std_logic_vector(AD_BITS_NUM-1 downto 0) := (others => '0');
--Outputs
--观测信号
--发端
signal send_frames : std_logic_vector(23 downto 0);
--收端
signal recv_frames : std_logic_vector(23 downto 0);
signal err_frames : std_logic_vector(23 downto 0);
signal ldpc_out_start : std_logic;
signal ldpc_out_ena : std_logic;
signal ldpc_out_data : std_logic;
signal send_en : std_logic;
signal DA_out_I1 : std_logic_vector(DA_BITS_NUM-1 downto 0);
signal DA_out_Q1 : std_logic_vector(DA_BITS_NUM-1 downto 0);
signal DA_out_I2 : std_logic_vector(DA_BITS_NUM-1 downto 0);
signal DA_out_Q2 : std_logic_vector(DA_BITS_NUM-1 downto 0);
-- Clock period definitions
constant clkIn_period : time := 7.8125 ns; --128MHz时钟
BEGIN
-- Component Instantiation
uut: top_tb PORT MAP(
clkIn => clkIn,
AD_in_C1 => AD_in_C1,
AD_in_C2 => AD_in_C2,
AD_in_S1 => AD_in_S1,
AD_in_S2 => AD_in_S2,
DA_out_I1 => DA_out_I1,
DA_out_I2 => DA_out_I2,
DA_out_Q1 => DA_out_Q1,
DA_out_Q2 => DA_out_Q2,
src_data_select => src_data_select,
src_data_fromTop => src_data_fromTop,
enc_start_fromTop => enc_start_fromTop,
send_frames => send_frames,
--收端
recv_frames => recv_frames,
err_frames => err_frames,
ldpc_out_start => ldpc_out_start,
ldpc_out_ena => ldpc_out_ena,
ldpc_out_data => ldpc_out_data,
send_en => send_en
);
clkIn_process :process
begin
clkIn <= '0';
wait for clkIn_period/2;
clkIn <= '1';
wait for clkIn_period/2;
end process;
END;

Related

OpenSSL SSL_read: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac, errno 0

I am running this piece of code on a Apache server in order to retrieve few zip files.
$ch = curl_init("https://opendata-rncs.inpi.fr/services/diffusion/document/get?
listeIdFichier=" . $listFilesId);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
$headers = array(
"Cookie: " . $token,
'login: xxxxxxxxxx',
'password: '. $this->tokenApiInpi,
"Content-Type: application/json",
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
$raw_file_data = curl_exec($ch);
if(curl_errno($ch)) {
echo 'error:' . curl_error($ch);
}
curl_close($ch);
On my local machine it works fine, running on a simple symfony server.
But on the Apache production server, I ve got this error:
OpenSSL SSL_read: error:1408F119:SSL
routines:ssl3_get_record:decryption failed or bad record mac, errno 0
Sometimes it works, but it's rare.
OpenSSL 1.1.1f 31 Mar 2020
cURL Information => 7.68.0
curl_getInfo()
array:37 [
"url" => "https://opendata-rncs.inpi.fr/services/diffusion/document/get?listeIdFichier=229514679,230627776,222612310,233647858"
"content_type" => "application/zip"
"http_code" => 200
"header_size" => 705
"request_size" => 291
"filetime" => -1
"ssl_verify_result" => 0
"redirect_count" => 0
"total_time" => 0.462636
"namelookup_time" => 0.003911
"connect_time" => 0.008549
"pretransfer_time" => 0.038412
"size_upload" => 0.0
"size_download" => 703824.0
"speed_download" => 1523428.0
"speed_upload" => 0.0
"download_content_length" => 5362987.0
"upload_content_length" => -1.0
"starttransfer_time" => 0.430148
"redirect_time" => 0.0
"redirect_url" => ""
"primary_ip" => "81.252.220.78"
"certinfo" => []
"primary_port" => 443
"local_ip" => "10.1.2.7"
"local_port" => 53494
"http_version" => 2
"protocol" => 2
"ssl_verifyresult" => 0
"scheme" => "HTTPS"
"appconnect_time_us" => 38371
"connect_time_us" => 8549
"namelookup_time_us" => 3911
"pretransfer_time_us" => 38412
"redirect_time_us" => 0
"starttransfer_time_us" => 430148
"total_time_us" => 462636
]

in CLIPS, I have to use conflict resolution strategies, can someone help me add the strategies?

;;; ***************************
;;; *DEF TEMPLATES AND DEF FACTS *
;;; ***************************
(deftemplate UI-state
(slot id (default-dynamic (gensym*)))
(slot display)
(slot relation-asserted (default none))
(slot response (default none))
(multislot valid-answers)
(slot state (default middle)))
(deftemplate state-list
(slot current)
(multislot sequence))
(deffacts startup
(state-list))
;;;****************
;;;* STARTUP RULE *
;;;****************
(defrule system-banner ""
=>
(assert (UI-state (display WelcomeMessage)
(relation-asserted start)
(state initial)
(valid-answers))))
;;;***************
;;;* QUERY RULES *
;;;***************
(defrule determine-engine-state ""
(logical (start))
=>
(assert (UI-state (display StartQuestion)
(relation-asserted engine-starts)
(response No)
(valid-answers No Yes))))
(defrule determine-runs-normally ""
(logical (engine-starts Yes))
=>
(assert (UI-state (display RunQuestion)
(relation-asserted runs-normally)
(response No)
(valid-answers No Yes))))
(defrule determine-rotation-state ""
(logical (engine-starts No))
=>
(assert (UI-state (display RotateQuestion)
(relation-asserted engine-rotates)
(response No)
(valid-answers No Yes))))
(defrule determine-sluggishness ""
(logical (runs-normally No))
=>
(assert (UI-state (display SluggishQuestion)
(relation-asserted engine-sluggish)
(response No)
(valid-answers No Yes))))
(defrule determine-misfiring ""
(logical (runs-normally No))
=>
(assert (UI-state (display MisfireQuestion)
(relation-asserted engine-misfires)
(response No)
(valid-answers No Yes))))
(defrule determine-knocking ""
(logical (runs-normally No))
=>
(assert (UI-state (display KnockQuestion)
(relation-asserted engine-knocks)
(response No)
(valid-answers No Yes))))
(defrule determine-low-output ""
(logical (runs-normally No))
=>
(assert (UI-state (display OutputQuestion)
(relation-asserted engine-output-low)
(response No)
(valid-answers No Yes))))
(defrule determine-gas-level ""
(logical (engine-starts No)
(engine-rotates Yes))
=>
(assert (UI-state (display GasQuestion)
(relation-asserted tank-has-gas)
(response No)
(valid-answers No Yes))))
(defrule determine-battery-state ""
(logical (engine-rotates No))
=>
(assert (UI-state (display BatteryQuestion)
(relation-asserted battery-has-charge)
(response No)
(valid-answers No Yes))))
(defrule determine-point-surface-state ""
(or (logical (engine-starts No)
(engine-rotates Yes))
(logical (engine-output-low Yes)))
=>
(assert (UI-state (display PointsQuestion)
(relation-asserted point-surface-state)
(response Normal)
(valid-answers Normal Burned Contaminated))))
(defrule determine-conductivity-test ""
(logical (engine-starts No)
(engine-rotates No)
(battery-has-charge Yes))
=>
(assert (UI-state (display CoilQuestion)
(relation-asserted conductivity-test-positive)
(response No)
(valid-answers No Yes))))
;;;****************
;;;* REPAIR RULES *
;;;****************
(defrule normal-engine-state-conclusions ""
(logical (runs-normally Yes))
=>
(assert (UI-state (display NoRepair)
(state final))))
(defrule engine-sluggish ""
(logical (engine-sluggish Yes))
=>
(assert (UI-state (display FuelLineRepair)
(state final))))
(defrule engine-misfires ""
(logical (engine-misfires Yes))
=>
(assert (UI-state (display PointGapRepair)
(state final))))
(defrule engine-knocks ""
(logical (engine-knocks Yes))
=>
(assert (UI-state (display AdjustTimingRepair)
(state final))))
(defrule tank-out-of-gas ""
(logical (tank-has-gas No))
=>
(assert (UI-state (display AddGasRepair)
(state final))))
(defrule battery-dead ""
(logical (battery-has-charge No))
=>
(assert (UI-state (display ReplaceBatteryRepair)
(state final))))
(defrule point-surface-state-burned ""
(logical (point-surface-state Burned))
=>
(assert (UI-state (display ReplacePointsRepair)
(state final))))
(defrule point-surface-state-contaminated ""
(logical (point-surface-state Contaminated))
=>
(assert (UI-state (display CleanPointsRepair)
(state final))))
(defrule conductivity-test-positive-yes ""
(logical (conductivity-test-positive Yes))
=>
(assert (UI-state (display LeadWireRepair)
(state final))))
(defrule conductivity-test-positive-no ""
(logical (conductivity-test-positive No))
=>
(assert (UI-state (display CoilRepair)
(state final))))
(defrule no-repairs ""
(declare (salience -10))
(logical (UI-state (id ?id)))
(state-list (current ?id))
=>
(assert (UI-state (display MechanicRepair)
(state final))))
;;;*************************
;;;* GUI INTERACTION RULES *
;;;*************************
(defrule ask-question
(declare (salience 5))
(UI-state (id ?id))
?f <- (state-list (sequence $?s&:(not (member$ ?id ?s))))
=>
(modify ?f (current ?id)
(sequence ?id ?s))
(halt))
(defrule handle-next-no-change-none-middle-of-chain
(declare (salience 10))
?f1 <- (next ?id)
?f2 <- (state-list (current ?id) (sequence $? ?nid ?id $?))
=>
(retract ?f1)
(modify ?f2 (current ?nid))
(halt))
(defrule handle-next-response-none-end-of-chain
(declare (salience 10))
?f <- (next ?id)
(state-list (sequence ?id $?))
(UI-state (id ?id)
(relation-asserted ?relation))
=>
(retract ?f)
(assert (add-response ?id)))
(defrule handle-next-no-change-middle-of-chain
(declare (salience 10))
?f1 <- (next ?id ?response)
?f2 <- (state-list (current ?id) (sequence $? ?nid ?id $?))
(UI-state (id ?id) (response ?response))
=>
(retract ?f1)
(modify ?f2 (current ?nid))
(halt))
(defrule handle-next-change-middle-of-chain
(declare (salience 10))
(next ?id ?response)
?f1 <- (state-list (current ?id) (sequence ?nid $?b ?id $?e))
(UI-state (id ?id) (response ~?response))
?f2 <- (UI-state (id ?nid))
=>
(modify ?f1 (sequence ?b ?id ?e))
(retract ?f2))
(defrule handle-next-response-end-of-chain
(declare (salience 10))
?f1 <- (next ?id ?response)
(state-list (sequence ?id $?))
?f2 <- (UI-state (id ?id)
(response ?expected)
(relation-asserted ?relation))
=>
(retract ?f1)
(if (neq ?response ?expected)
then
(modify ?f2 (response ?response)))
(assert (add-response ?id ?response)))
(defrule handle-add-response
(declare (salience 10))
(logical (UI-state (id ?id)
(relation-asserted ?relation)))
?f1 <- (add-response ?id ?response)
=>
(str-assert (str-cat "(" ?relation " " ?response ")"))
(retract ?f1))
(defrule handle-add-response-none
(declare (salience 10))
(logical (UI-state (id ?id)
(relation-asserted ?relation)))
?f1 <- (add-response ?id)
=>
(str-assert (str-cat "(" ?relation ")"))
(retract ?f1))
(defrule handle-prev
(declare (salience 10))
?f1 <- (prev ?id)
?f2 <- (state-list (sequence $?b ?id ?p $?e))
=>
(retract ?f1)
(modify ?f2 (current ?p))
(halt))
Use the set-strategy command to change the conflict resolution strategy.
CLIPS (6.4 2/9/21)
CLIPS> (set-strategy breadth)
depth
CLIPS>
You can call this command anywhere you can normally call commands but typically you would call it either at the command prompt or from the actions of a rule.

how to check array in where condition in codeigniter?

in code igniter a group of student details check in fore-each loop ,the student get by the bases of student admission number
my admission numbers are in $ad_no=$this->input->post('adn_no'); :-
array(5) { [0]=> string(5) "11784" [1]=> string(5) "11837" [2]=>
string(5) "11775" [3]=> string(5) "11937" [4]=> string(5) "12061" }
i try to select these admission numbers student, but the result show only first student result
.
my code:
foreach($ad_no as $key => $id) {
$this - > db - > where_in('ad_no', $id);
$query = $this - > db - > get('duration');
$r = $query - > result_array();
$dur = $r[0]['tot_hr'];
$start = explode(':', $dur);
$end = explode(':', $tm);
$total_hours = $start[0] - $end[0];
$total_hours1 = $start[1] - $end[1];
$mins = abs($total_hours1);
$dur = $total_hours.":".$mins;
$durs[$key] =
array(
'ad_no' => $ad_no[$key],
'tot_hr' => $dur
);
}
$reslt = $this - > Daily_temp_model - > duration($durs);
using array push in foreach loop
$result=[];
foreach($ad_no as $key => $id) {
$this->db->where_in('ad_no', $id);
$query = $this-> db-> get('duration');
$r = $query-> result_array();
array_push($result, $r);
$dur = $r[0]['tot_hr'];
$start = explode(':', $dur);
$end = explode(':', $tm);
$total_hours = $start[0] - $end[0];
$total_hours1 = $start[1] - $end[1];
$mins = abs($total_hours1);
$dur = $total_hours.":".$mins;
$durs[$key] =
array(
'ad_no' => $ad_no[$key],
'tot_hr' => $dur
);
}
$reslt = $this->Daily_temp_model->duration($durs);
using in_array
<?php
$a = array('1.10', 12.4, 1.13);
if (in_array('12.4', $a, true)) {
echo "'12.4' found with strict check\n";
}
if (in_array(1.13, $a, true)) {
echo "1.13 found with strict check\n";
}
?>

Saving one-to-Many relation data in phalcon

I have a Model Course with many relationship with timing. How do i update all the timings.
$course_Timeing = $course->courseTimings;
$m = new MultipleIterator();
$m->attachIterator(new ArrayIterator($this->request->getPost('date', 'string')), 'date');
$m->attachIterator(new ArrayIterator($this->request->getPost('timeFrom', 'string')), 'timeFrom');
$m->attachIterator(new ArrayIterator($this->request->getPost('timeTo', 'string')), 'timeTo');
$i = 0;
foreach ($m as $unit) {
//print_r($unit);
if (!empty($unit[0]) && !empty($unit[1]) && !empty($unit[2])) {
$course_Timeing = $course->courseTimings[$i];
$course_Timeing->assign(array(
//'course_id' => $course->id,
'date' => date('Y-m-d', strtotime($unit[0])),
'timeFrom' => date('H:i:s', strtotime($unit[1])),
'timeTo' => date('H:i:s', strtotime($unit[2])),
));
}
$i++;
}
$course->save does not save timings
Well i found a way out by
$course_Timeing = $course->courseTimings;
$m = new MultipleIterator();
$m->attachIterator(new ArrayIterator($this->request->getPost('date', 'string')), 'date');
$m->attachIterator(new ArrayIterator($this->request->getPost('timeFrom', 'string')), 'timeFrom');
$m->attachIterator(new ArrayIterator($this->request->getPost('timeTo', 'string')), 'timeTo');
$i = 0;
foreach ($m as $unit) {
//print_r($unit);
if (!empty($unit[0]) && !empty($unit[1]) && !empty($unit[2])) {
//$course_Timeing = $course->courseTimings[$i];
$course_Timeing[$i]->assign(array(
//'course_id' => $course->id,
'date' => date('Y-m-d', strtotime($unit[0])),
'timeFrom' => date('H:i:s', strtotime($unit[1])),
'timeTo' => date('H:i:s', strtotime($unit[2])),
));
if (!$course_Timeing[$i]->save()) {
foreach ($course_Timeing[$i]->getMessages() as $message) {
$this->flash->error($message);
}
}
}
$i++;
}

How to set dynamic variable value in Editablefield Using yii booster?

I am trying to pass a variable $time in the URL parameter. The whole widget is inside a foreach loop and $time is updated each time the lop is executed. Now the problem I am facing is that the $time (which is passed in url parameter) is not updated.
$dataProvider = StaffHours::model()->findAll();
$start = strtotime('12:00am');
$end = strtotime('12:45am');
for( $i = $start; $i <= $end; $i += 900)
{
$time = date('g:i A', $i);
foreach($dataProvider as $data)
{
$monday = unserialize($data->monday);
$this->widget('bootstrap.widgets.TbEditableField', array(
'type' => 'select',
'model' => $data,
'attribute' => 'monday',
'url' => $this->createUrl('staffhours/editstaffhour&Time='.$time ), //url for submit data
'source' => array('Online', 'Offline', 'AwayDate'),
'enabled' => true,
'options' => array('params' => array('time'=>$time),)
));
}
}