8. If the line $y=x$ is tangent to the curve $y=x^{3}-3 x^{2}+p x$, then the value of the real number $p$ is $\qquad$
8.1 or $\frac{13}{4}$.

Let the point of tangency be $(m, m)$, then by the point of tangency on the curve we have
$$
m=m^{3}-3 m^{2}+p m \text {. }
$$

Thus, $m$ satisfies
$$
m=0 \text {, }
$$

or $m^{2}-3 m+p=1$.
The slope of the tangent line $y=x$ is 1, and the slope at the point of tangency on the curve is also 1, hence
$$
1=3 m^{2}-6 m+p .
$$

Solving equations (1) and (3) together, we get $p=1$;
Solving equations (2) and (3) together, we get $p=\frac{13}{4}, m=\frac{3}{2}$.