  This paper investigates an intelligent reflecting surface (IRS) aided
millimeter-wave integrated sensing and communication (ISAC) system.
Specifically, based on the passive beam scanning in the downlink, the IRS finds
the optimal beam for reflecting the signals from the base station to a
communication user. Meanwhile, the IRS estimates the angle of a nearby target
based on its echo signal received by the sensing elements mounted on the IRS
(i.e., semi-passive IRS). We propose an ISAC protocol for achieving the above
objective via simultaneous (beam) training and sensing (STAS). Then, we derive
the achievable rate of the communication user and the Cramer-Rao bound (CRB) of
the angle estimation for the sensing target in closed-form. The achievable rate
and CRB exhibit different performance against the duration of beam scanning.
Specifically, the average achievable rate initially rises and subsequently
declines, while the CRB monotonically decreases. Consequently, the duration of
beam scanning should be carefully selected to balance communication and sensing
performance. Simulation results have verified our analytical findings and shown
that, thanks to the efficient use of downlink beam scanning signal for
simultaneous communication and target sensing, the STAS protocol outperforms
the benchmark protocol with orthogonal beam training and sensing.
